Rendering optimization

Hey everyone, a lot of times, I tried to make a big terrain of blocks using a script, But when i reach some count, the engine lags out really bad especially for lower-end devices, so i was thinking if we could disable rendering an object in Roblox, like in Unity we can just disable the renderer component of the object !

If you set the transparency to 1, I believe it removes it from rendering. Same thing if you set the parent to nil. But I think the transparency route is more “efficient” if you have to toggle it often. Of course, it’s all still in memory, so you won’t see an improvement there.

If you’re procedurally generating, then you can get away with only rendering so much at a time and cleaning up parts that are far away.

Also, workspace.StreamingEnabled will help for lower-end devices.

8 Likes

Wouldn’t turning parts invisible and visible be bad for performance or am I wrong?

Repeatedly doing so would have a large performance impact, yes. This is because every time you put it back into the rendering pipeline, lighting updates have to made again on all of the new parts (lighting caches and stuff probably). Furthermore, the ability to precompute given static geometry is diminished every time you change it. However, if you keep if you are hiding parts and keeping it that way, then there really won’t be that much of an impact.

v.material = Enum.Material.Air

1 Like

So in theory if the GlobalShadows are turned off there would be a performance gain?

I don’t suggest anyone trying that since the feature isn’t fully supported as I recall