Render Distance/Streaming Alternatives

I have a map that is densely populated with trees, which can caused well, lag.
The trees are a main factor of detail, and they are two very thin parts unioned together with a decal on them.

I tried streaming which worked but broke scripts and was buggy (how streaming always is, and I don’t want the entire map to render in), and then I tried to find a script that deleted/stored the objects in somewhere, like server storage.

I’m not sure what to do, so I came here for help.
Any suggestions or comments are welcome.

EDIT : I have little knowledge on how to script, but I can do basic editing.

5 Likes

StreamingEnabled doesn’t delete assets. If you were to check the explorer you would see a bunch of empty models. The reason why your scripts broke is because you haven’t used WaitForChild(). Because you had streaming enabled on its possible the client didn’t receive the part yet. Therefore you had no valid references.

Streaming is clientside not serverside. So ServerStorage would not be a valid option. ReplicatedStorage is an option, but then you would want to implement your own streaming implementation.

Its not buggy when you use it correctly.

4 Likes

Streaming would work, but I don’t really want to have the entire map render in, only the trees. I worded it wrong in the post.

Then in that case, I would put my trees in ReplicatedStorage, and have some sort of look up table, to see where they should be. And simply stream them in based on the distance the player is from the position of the tree. Keep in mind, since this would be strictly local trees wouldn’t be synced across multiplayer. But if you aren’t doing anything special with your trees, then this would not be a problem.

Also take note that Roblox does have instancing, so if all your trees look the same it will render them in one draw call instead of a single draw call per tree. :thinking: so why would you be getting any negative impacts from your trees in the first place… Idk. Do you have outlines enabled by any chance?

Large amounts of parts that aren’t anchored effect physics, but you should be able to get at least a thousand trees without FPS lag with the trees anchored. (Depending on how expensive the tree is for rendering)

3 Likes

Thanks for the help. I’ll try working on this solution.

Responding to your edit, I don’t have outlines on and there are about 25,000 trees so far, but they are invisible parts with a decal on them.

Transparent parts are actually more taxing on the renderer than regular parts. But I’m not sure if this applies to only values above 0.2 or a fully invisible part itself. :thinking: That is a lot of trees though.

1 Like

It might also be caused by shadowmap since I have castshadows on.

I saw somewhere that fully transparent parts are removed from the rendering pipeline (correct me if im wrong). But parts that are semi-transparent are indeed more taxing on performance.

Shadowmap is likely to be causing any performance trouble with 25,000 separate trees all casting shadows. I would either turn castshadows off for the trees or turn shadowmap off.

1 Like

Let me get straight to the crux of the issue: this level performs poorly because decals over transparent parts are really bad (especially at this scale.)

I also don’t recommend attempting a custom streaming solution. Constantly moving this many instances in and out of the workspace will most likely make your game chug like a steamboat. I learned this the hard way.

Solving this is a bit hard because you presumably want to maintain the look of your level, and this specific technique (decals on transparent parts) is admittedly difficult to replicate in a way that won’t nuke the rendering pipeline. Your best bet at this point would be to replicate the tree as best you can in a 3D modelling suite.

@zeuxcg’s posts are a good resource for general information on performance, and you’ll have an easier time creating nicely performing levels if you understand more about the rendering pipeline.

Edit: Now that I think of it, I actually did solve a similar problem a while back. My solution was importing my decal into Blender, then tracing around it in front ortho and making a face, like so:

palmmesh

This gives you a single faced mesh which you can then texture in studio (I believe you can even just use the same textureID from the decal:)

palms

That model above is only about ~20 kb including the texture, and we don’t have to deal with any performance killing transparency. I imagine you could abstract this method for your two intersecting faces pretty easily. An added plus is being able to alter RenderFidelity for even more performance gains.

3 Likes