Use Shapes to render splines

Avatar
  • updated

For a game project I'm working on a real-time in-game 3D spline editor. I'm using URP, Unity's Spline package and my own meshing around the spline.

I was mesmerized by the quality of splines in Freya's videos and was wondering if Shapes would work better for rendering splines than my CPU meshing. The rendering here is absolutely superb. I'm getting dizzy when thinking how much work it is.

Youtube video

My question is: What is the best approach for using Shapes to render splines?

Is it a piecewise-linear polyline, or something else? Immediate mode or not? Any tips are greatly appreciated.

  • The splines need to be textured and with variable thickness within one spline.
  • They also merge and split.
  • There are quite a bit of general 3D object besides the splines.
  • I'm OK with writing custom code shaders.
  • The splines are flat (not full 3D extrusion), always facing straight up (not necessarily at the camera).
Reporting a bug? please specify Unity version:
2023.2
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
URP
Avatar
Freya Holmér creator

I use piecewise linear 2D polylines throughout my spline video! Although none of mine are textured, so you'd have to add UVs to the Shapes polyline mesh generator, and then customize the shader to support textures, which Shapes doesn't support out of the box