I was wondering if there is a texture changing based on the centerline to the edge.
It basically lets you texture an object by having other objects intersect with it (or just get near it, depending on the radius you define), and set colors for inside, outside, near and far ranges. Like I have a model and also its centerline. I basically want the the distance from a centerline…Like for individual vessel it will change the color from center to its edge. And that would give me the radius.
I am sorry for all the confusions. I draw it in 2D( i thought it would make this clear. sorry again) but my mesh is 3D. I already get the centerline from another algorithm. And yes “color in the nearest distance” can be the same as “color in the negative distance”. yeah. Its like I want a gradient extending from centerline to edge of mesh in 3D.To clarify more, I attached my model here. This is a mesh of some vessels. So what I want is Like for individual vessel it will change the color from center to its edge. The gradient change will happen for each vessel. not the whole mesh from center to edge. That’s why I was talking about centerline
I am also okay if there is any way I can do that without using the centerline mesh. I just need a gradient extending from center to the edge of mesh in 3D. Like it will change the color from center to its edge.
You could try to use @higgsas 3D skeleton node group and add a Geometry Proximity node at the end of the simulation zone to get the distance from your mesh to the skeleton:
I take it the gradient you want is “inside” the mesh (from the center to the outer edge.)
Normally materials map to the surface of objects, not to their “volume”, the surface of the object would end up on the “greater” side of the gradient (the furthest values from the centre line).
If the distance is from the center line to the outer edge (0-1) the outer edges/faces would have a value of 1 which would be the colour the surface. If it is a standard surface material, the whole surface and object would have the same value.
Geometry nodes might get you a gradient from the centre line to the surface but I do not know how to go about it. There is then the problem of visualizing the inside of the object.
This sounds like a medical project and it is as if you are looking at the vessels in a depth sensitive microscope, seeing their outer bounds and a cut section of the inside of them.
There should be a way to “mimic” this but it would involve a non physical “hack”
I am not sure how you could visualize this with a shader, the only thing that comes to my mind is a volume shader. Volume shaders do map to the volume.
But maybe this is not what you are after.
Thank you @DNorman and @Zebrahead for all the supports and help. I really appreciate. @DNorman can you please post the rest of the shading approach? (left side of the image you posted) .
Thanks again.
It just goes into the volume input of the material output.
I am using Blender 4.0 and AGX colour management. AGX will turn emmisive colours white at high values. If you are using the Filmic colour management the colour will clip a bright red and not go into those white values.
It is probably not a very controllable way to do this, volume absorption absorbs light and the colours will not always act in the way you expect. Changing the colour of the world lighting will change the effect.
Also this shader will look like this from an angle:
Wow. It’s incredible. Thanks a ton for giving it a lots of thought and time. Its literally what I expected. It really helped me a lot. And I also learned a lot of techniques for better rendering. Thank you so much…