Texture-Coordinate proximity shader for curve

Given any object it is relatively easy to create an influence vector, using the distance from the Texcoord to create a per-pixel gradient in order to color an object:

The point of using this Texcoord-distance method is to avoid the resolution and “blocking”, precision issues that arise from using geometry proximity, dynamic paint or other similar methods, and can therefore be used on any type of mesh. at any point

Curves

The problem is that it works only for a single vector point value.

How would you go about extending this method to work with a curve and sample all points on that curve to draw the entire shape of that curve, being influenced by its radius.

Basically, to compute all values from 0-1 in the Sample Curve factor to calculate that distance from the surface to the curve.

The purpose would be to create procedural shading for skin, that has internal veins (a single curve with many splines of different radii), and project that curve as a gradient based on the distance and radius to the skin.

What I Need (Photoshopped):

THANK YOU !!!

Blender 4.0 .blend File:
Dev.blend (160.3 KB)

You can’t really get the positions of the whole curve… you have to keep in mind that geometry nodes is constrained by the Geometry you are working with… you can only pass info from GN to the material at the resolution of the underlying geometry.

So, here, to get anything usable you have to subdivide the mesh to hell-and-gone:

Practically that means that you can’t really have anything dynamic using this technique as you have to subdivide, make the texture, then bake it onto the low-poly version… and even then you’ll have artefacts at boundaries (which you’ll need to tweak color-ramp to get rid of and there’ll be some circumstances where you can’t):
image

Sorry for unsatisfactory answer.

1 Like

Thank you regardless for the effort. I’ve been stuck on this for a few months and the only hope I think i have is OSL, which is fickle, slow, and the available input information and documentation on how to work with blender attributes is pretty much 0… And even then, curve information is probably unavailable for OSL… guess I’ll wait till blender v9000.0 when we get either a whole bunch of new complex nodes or a C++ Rendering API or something :confused:

1 Like