Download

Spline mesh component optimization problem, and the ISM/HISM transform.

Hi! I’m playing with the procedural road creation and have a feeling that i’m probably missing something vital in my understanding on how the spline mesh component works. I learned from the other topics that the spline component meshes can’t be instanced. But then it’s having an impact on my performance if i’m trying to implement some road network with it. I managed to narrow the problem to the length of the spline. While the material or the collision is having no impact on the performance, the cause must be the road mesh. Both, the spline and the mesh is set to static. But then, i can’t figure out what is actually bottlenecking the FPS. As i tried using either a small segment with about 600 vertices and another that is just a plane with 4 vertices, the difference in FPS was only 10 frames (20 FPS with the 600 vertices shape, and 30 FPS with only the 4 vertices plane).

Another thing that i noticed is the FPS drops down significantly from when my camera is looking to any other direction from the generated road (approx. 90-100 FPS), and then down to 20/30 FPS when i’m looking toward the road’s end point. And it does not matter if the road’s visibility is completely blocked with some ISM cubes. It looks like that the road is being rendered anyways, despite the visibility blocking.

And another question, hope someone could help me with the understanding on how it is working in general. Why it is possible to make some transform to the actual ISM/HISM meshes (Instance Transform), and the spline mesh component is not allowing such transformations for the number of the same mesh transformed along the spline?

Thank you for the patience reading this, and i sincerely hoping you could help me to find some answers to my questions!

@Ashh111 Did you manage to find a workaround? If so, care to share?

spline meshes are never instanced by design.
you can twist and turn each segment differently, so it can’t really be instanced.

OP you should look at MS costs, not fps.

10fps can be a lot on something like an rtx or next to nothing on a gtx1060

Instead of using the spline component as is, you should use it as the general pathway for things to use.
and manually place road segments in that can be instanced properly.
I belive you can also convert the spline mesh to static, which should save some performance and allow for occlusion.

You most definitely need to deselect the spline when looking at performance.
And your road mesh most definitely needs a decent LOD system to go from whatever crazy amount of verts to something sub 100.