Optimizing Tree Meshes with a Sprite LOD

Hello!

I’m making an extremely large map (at least 16 square kilometers), which will be densely forested at some points. In order to increase performance I’ve looked into turning the tree mesh into just an image set to follow the camera after a certain distance.

I’m unsure if this will actually do enough to performance in order to justify the optimization, as the actual mesh will still be physically in the workspace, but all intensive parameters will be disabled:

CanCollide = false
Transparency = 1
CastShadow = false

I’m really unfamiliar on how Roblox will internally operate with these changes, especially considering I will have to double the tree mesh count with each having a sprite LOD version.

1 Like

reparenting the meshes to nil should be enough. just keep a reference to them so they don’t get gc’d

Won’t that cause intense lag, as it’s the same as destroying a mesh? Correct me if I’m wrong. But the character will be moving at around 50-100 studs per second, so the amount of trees being parented to nil can be tens or hundreds per frame, which might cause obvious issues if parenting it to nil is as intensive as running a :Destroy() function on it.

its not. you should batch them though, have chunks of trees that get streamed at once, dont do it every frame, etc

1 Like

Would you recommend something similar to an Octree system?

yeah, that would probably work well

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.