how to progressive rendering a mesh?

Hi guys,

I have a bezier curve on which I draw a mesh. I want to render it progressively. You can see the final result on this video:

For achieve this result I build the mesh vertex dynamically but I think that this isn’t the best method.
Is there a better way to do this without rebuild the mesh? For example using a shader or uv map? Unfortunately I am not practical of this subjects.

Well progressively based on what?

If it should appear based on “time” you can give each vertex a time value when it should be visible. Inside a shader you can use the _Time.y value inside the fragment shader to selectively show parts of the curve. The nice thing is that vertex parameters are interpolated across the triangles so you get an actual cut off line in between.

If it shouldn’t be based on time but another provided value it would work the same way, just use your own shader parameter which you can adjust from a script the way you like.

Note using time directly may not give nice results if the time grows too large the precision drops. So using your own “time” which you.

If your mesh does not use uv coordinates you could use those to encode your “time” value. Otherwise you can use any other value like color, uv2, … Keep in mind that most vertex values are actually float4 even only 2 are used most of the time.