Invisible parts and performance

If I were to have a bunch of invisible parts, how would it affect performance compared to if they were visible? I’d like to add LOD in my game where things that are further away are turned invisible or swapped with lower quality models.

3 Likes

If I remember correctly 1 transparency completely removes the part from the rendering pipeline.

8 Likes

And then making them non-collide would disable the physics?

Sorta. It’ll prevent some math from being done but not completely.

3 Likes

Transparency 1 has best performance, transparency 0 after that, and anything between 0-1 is worse. (Rendering-wise, obviously. Parts still take memory and there may still be physics simulation with these parts on the CPU)

Parenting things in/out of the game hierarchy makes it so that data structures related to physics have to be updated among other tasks, so this is not free. Just try both solutions and see which works best.

8 Likes

Problem with LOD systems is that removing or making parts transparent means there must be lighting updates, which can cause frame drops when things are constantly changing. These usually make it pointless or worse having an LOD system, unless you can find a way around this. If you do, I would really like to know how. Good luck though!

Invisible parts have minimal to no impact on performance, just worry about the physics associated with your game (i.e. if a bullet needs to pass that invisible part).

Quick question,
Do you know if this applies to decals and textures aswell?

Yes I don’t see why those would be different w.r.t. transparency.

You should always try in a scenario that represents what you’re trying to do and then measure the cost with microprofiler in both situations to properly compare.

In general, having invisible parts (i.e., parts with Transparency set to 0 or with the SurfaceTransparency property set to 1) can still impact performance because they are being processed by the rendering pipeline. However, their impact is generally less than fully visible parts.

When you are implementing LOD (Level of Detail) in your game, you are on the right track. The idea is to replace or modify the models with lower-poly versions or models with fewer details when they are farther away from the player’s viewpoint. This approach can significantly improve performance by reducing the number of polygons and textures that need to be rendered.

Here are some suggestions:

  1. Use Culling: Implement frustum culling to avoid rendering objects that are outside the camera’s view frustum. This can be combined with LOD to enhance performance further.
  2. Distance-Based LOD: Determine the distance of the objects from the player and switch to lower-detail models as the distance increases. This can be done dynamically based on the player’s viewpoint.
  3. Batching: Try to batch similar objects together. Batching involves combining similar objects into a single mesh, reducing the number of draw calls and improving performance.
  4. Use Roblox’s LOD System: Roblox has built-in LOD (Level of Detail) support. By default, the engine automatically generates lower-detail versions of models, but you can also manually create LOD models to have more control.

TIP:

Remember to test and profile your game to ensure that the LOD system is providing the expected performance improvements. The impact of invisible parts, in comparison to visible parts, will depend on the specifics of your implementation and the overall complexity of your scene. Always consider the trade-offs between visual quality and performance to achieve the best balance for your game.