Render splines using Cycles hair primitives
This is a Cycles modification for Blender 2.8
Repo: https://github.com/nantille/blender_28_mod
Since hair is available in Cycles, I built on that to make mesh-less splines renderable as hair primitives with custom radii and data.
I edited Cycles and Blender, initially 2.79 and now 2.8 to do this.
This modification allows you to skip meshing splines entirely and render them as hair.
Needless to say, with this method you can render *lots* of them (hello large-scale).
Here's an example image made with vasculature data.
This is particularly useful in the visualisation of graph structures such as trees, random walks, cells, etc.
This has been working in production on Ubuntu clusters and MacOS machines seamlessly.
Current Blender 2.8 mod features
- Splines to hair: render all splines within a curve object as hair in one click in the UI, also easily scriptable.
- Radius variation: splines are rendered with their radii so this is more than simple tapering hair.
- Spline interpolation: all curve types are supported. Two interpolations may occur and affect hair, see Usage below.
- Per-spline material: supported. You need to add the materials to the curve object and then set the material_index of each spline.
- Two custom values on spline points: key and value, two floats. This takes 8 bytes extra per spline point in memory but gives you the ability to modulate your shaders based on these values as they're available in HairInfo node.
- Extra spline metrics available in HairInfo node: Spline Index, Splines Count, Spline Length
- Increased transparency limit to enormous numbers to let the user play with transparency + many splines
*Warning* When you save .blend files with this version, *do not save them with another version of Blender* or custom key-value data will be lost! You've been warned.
I got rid of all bugs *except one*. It happens in preview mode only: if you add a material to a curve that had none and that is set to be rendered as hair, you get an immediate Blender crash. Malloc is unhappy about an object was modified after being freed.
It's not too much of a problem if you know about the issue but something to solve still. If you have any clue, don't hesitate to mention it!
Deprecated, earlier mod for Blender 2.79 (only here to keep track of history)
Repo: https://github.com/nantille/blender_mod
This version lacks features 3 to 6 in the list above.
Issues in that old version:
- crashes when using both particle systems with hair AND this modification. [solved in Blender 2.8 mod above]
- every spline last point is not used by the hair primitive. [solved in Blender 2.8 mod above]

