Create spline mesh without spawning multiple SplineLoftActor?

I want to use splines to create pipes that the player can place at various lengths.

Is there anyway to use a SplineComponent for deforming a mesh without having to spawn multiple SplineLoftActors?

I’m trying to avoid spawning too many actors if possible.

Also worth saying, that the pipes I’m creating only need to be straight (not bend), so I only care about allowing them a variable length. So i could possibly avoid using splines altogether, and simply adjust the mesh using ScaleX. Any suggestions are welcome.

Hi Coldscooter,

Yes, if they’re all straight, create StaticMeshInstances instead - that will be a much faster way of doing it…

Is there a noticeable difference in performance cost between using spline mesh components and static mesh components (seeing as SplineMeshComponent extends from StaticMeshComponent)? Especially if i’m disabling ticking on the actor that it is attached to.

Also with regards to my original question. I noticed I can simply use SplineMeshComponent, so i don’t need to spawn additional actors to render mesh splines during gameplay.

Yes (That’s correct, add Components rather than Actors) you’ll see a performance increase by using StaticMeshComponents rather than SplineMeshComponents - but the real increase in speed would be to create one “InstancedStaticMeshComponent” - and just AddInstance()'s to that - those will be considerably faster.

Pretty sure you are referring to UE4/5. This is the UDK (unrealscript) forum. But your advice is sound regarding using an instanced static mesh component rather than many individual components to cut back on draw calls.

I’d still like to understand what makes a static spline mesh component more costly than a static mesh component though. As once it is deformed, there should be no more additional cost, no? Any insight would be appreciated.

You’re right - my mistake!

I’m not too familiar with UDK, the difference may be minimal at run-time…

I think the trouble is see with using instanced meshes is that all instances would be sharing the same material, so longer pipes would have stretched textures. As far as i’m aware (frustratingly) there is no way to differentiate between instances in the material editor (at least in UDK).

Yeah, you could have a selection of meshes with their own lengths and materials and tile them out maybe?

One possible solution to this is world-space tiling. Then the problem becomes stretched textures at 45 degrees where the projection switches.