I tried to build a road with Static mesh Component with Spline Component, but the frame rate drops. I tried to use Instance Static Mesh Component with Spline Component but it doesn’t support Instance Static Mesh nor hierarchical Instance Static Mesh either. So I have made it with a Mesh in my 3d modelling program and have Instanced it. If Spline Components supported Instancing, it would help for low end computers.
I second this.
That would indeed help a lot. Any news on this? Is this possible to implement?
In very simplified terms, when you want to render a mesh you send off the vertices, the position, rotation, scale, shader data etc. to the GPU and it will take those vertices, transform them to the correct location and draw them. This is done for every single mesh.
Instanced static meshes work a bit differently - you only send in the vertices and shader data ONCE, but you send a bunch of transforms. The GPU then renders the same mesh a bunch of times. Due to this however you’re limited to every single mesh being identical. So unless spline sheer, twist and other deformations are included into the transform being passed on, then this ain’t happening.
Yeah, in this case it would require to store (start&end point loc/tangents/scale) in each instance instead of (loc/rot/scale) - and then somehow offset vertex positions based on this… But this is beyond my non-math brain
+1 We massively use Spline Meshes in our Project. Better Performance of them would boost our whole game performance.
- 1 for this feature from me.
Spline meshes play a huge role in our project, so I’d be happy for any sort of performance improvement I can get really.
I use spline meshes a lot, can we get instancing? After all, it’s rare that absolutely ALL meshes would be deformed in some way. There’s usually straight sections to the roads/tubes/cables/fences/whatever you’re using the spline mesh for.
I would like to have instancing too! With more splines the draw calls and performance is going down and there is for runtime created splines no better solution than instancing.
Please could somebody of the Epic-Team give us feedback if this feature request is noticed?
Yeah, it is is very strange, that we have a tool, that can’t be used for development. Only for visualize the idea
Seems pretty impossible to me.
Instanced Static Mesh Component does what it says: Instancing.
How do you want to instance something that is always unique (your Spline Mesh)?
Unless your Splines are the same (just with a different world transform),
It is indeed impossible by definition; spline meshes are static meshes that are deformed in the vertex shader and have generated collision geometry (where applicable). They cannot be instanced.
We use spline meshes here for things like walls, and it’s honestly not a problem, performance is perfectly fine.
If you are dealing with something like a road network then most of the sections will be exactly the same - straight piece of the road.
But anyway, I don’t think there is a generic way to solve it. If someone is in real trouble with spline mesh performance, they have to find solution that will work for them.
- Like use spline mesh component only for creating collision and bend instances of HISM in material to follow the spline.
- Write a custom tool that would analyze spline actor and distribute ISM and Spline Mesh where applicable, aka using HISM on sections with no deformation.
- Create instances of your mesh first and then make a tool that would constraint spline “road” only to use your instances.
Adding to the above list, you can generate the geometry in the editor and save it as an asset, then replace those with instances.