Download

Reduce Drawcalls in Splines drawn in real time with added Spline Mesh Components

Hey all,
i figured i might recreate the basics of Tiltbrush to understand the underlying technology.

Currently im creating splines in real time and adding meshes to the spline that bend and morph nicely.
While it looked great fast, i noticed that every single mesh that gets added to the spline increases the drawcalls even tough it uses the same material instance and such.
It makes sense, but i couldnt wrap my head arount to find a solution that batches every spline/stroke that i finish into a single mesh or is able to instance it along the spline ( i need the morphing ).

Any ideas on how to turn my spline + spline component approach into something more efficient. Big respect to the tiltbrush team as i simply dont understand how they manage to draw so many strokes on the screen without my pc exploding.

the wonders of rendering :smiley:

Had you found a solution to make draw call batching work with spline meshes?
I’m currently working on something similiar and I’m wondering If need to make my own spline meshes with a shader and the new mesh parameters.

that was a year ago, either way the basic principle is simple More Meshes = More Draw Calls. No real way around that other then re-creating the spline in a 3d program and making a single mesh (which has drawbacks as well, no occlusion for instance).

We coded our own solution using the RuntimeMeshComponent. We were mixing spline meshes and spline meshes baked together to a single mesh. Some magic here and there to controll the amount of poly, smoothes and in the end an export to fbx.

Anyone still interested check the RuntimeMeshComponent!
Meanwhile let me check if i can share bits of this project somehow.

Hello, If I’m understanding correctly I face the same problem I have a dynamic path with a lot of points (currently using splines) that I need to generate in runtime.

But quickly enough it destroys my frame rate, so the options I saw were:

1)either start with the splines and when the path has finished create Runtime Mesh Component
I tried this but partially succeed because i could only achieved creating runtimeMeshSection per splineMeshComponent but had some problems with UV’s,
and still with this amount of sections my fps was really low.

  1. go to the route of looking at how do i merge actors like the editor tool but with runtimeMeshComponent.

  2. create some spline system just with runtimeMeshComponent and ditch the splines seems the best option but a bit extreme in the amount of time it would take to achieve that.

If you could share some insight at how you manage to do that magic you’re talking about it would be really appreaciated :slight_smile: