Rhino Default Curve Shaders - how they work?

I am writing an application completely not related to Rhino, but related to how mesh boundary edges are visualized in Rust WGPU WGSL shader.

What OpenGL shader technique is used in Rhino?

  • 3d cylinders + 3d spheres mesh instances with transformations

  • 2D square billboards

  • geometry shader

When you really increase rhino8 line thickness you start to see some funny things, which is probably because of some sort of optimization when you need to draw a lot of things fast, so geometry must be simple.

If anyone could reveal some secrets how this was written would great.

I display on wgpu this using 3D pipes and spheres, which is for sure a bit more resource intensive, but accurate. I am using instancing to speed things up by one unit sphere and one unit cylinder. I am curious how this is done in Rhino.

that’s a question for @stevebaer

Curve information is stored as a series of Beziers on the GPU. We’ve written several different approaches to attempt to tessellate this Bezier information into a series of screen oriented triangles. Rhino uses instancing, geometry shaders, or tessellation shaders for this depending on which platform you are running on and what level of OpenGL you have Rhino set to.