Shader driven by thickness


This is probably a senior moment, but how do you drive a grayscale value based on the thickness of an object?

Modo has a gradient shader based on thickness, which is more or less what I want.


Paul Everett has a vertex map plugin called ‘Tools4D Advanced Topology Vertex Maps’

This will let you define ‘thickness’ via vertex maps, which I’m sure can be very quickly transferred to a greyscale gradient.

Maybe there’s a built in way, if so, I’m not aware of one.


Using Xpresso. Set the driver to be the thickness parameter, and the driven to be the color. Will likely have to tweak the range mapper input/output range for the desired effect.


Maybe I do not understand a fundamental part of the question, but from what I did
understand you have an object with some kind of floating point value like a diameter
or something like that and you want to create out of that value a color in a material/
shader ? There are various way to do that (mograph, expressions, xpresso), here is
the xpresso way.

  1. Get the source and the goal node into your graphview. Lets say our source is the
    diameter of a parametric cylinder and our goal is the color 1 in a noise shader.

  2. Create a range mapper node, set the minimum/maximum input values to the bounds
    within which you want to animate the cylinder’s radius. Set the minimum/maximum output
    value to 0.0/1.0. Feed your cylinder.radius output port into the rangemapper value port.

  3. Feed the result of the range mapper node into all three input ports of a vector node.

  4. Feed the vector node into the shader.color1 input port.


That volume depth map is pretty close to what I want. I’d like to not have to buy a plugin though, thought maybe I was missing something in the built-in shaders.


Thanks for the answer. I take it this “thickness” parameter is something I’ll have to calculate myself? I’m almost Xpresso illiterate.


Not sure if this works, I only got so far because I was using a non-parametric object and would have to sample radius in different areas of the object.

Here’s what I’m looking for (based on the Modo online help):

“Thickness-- Determines how thick or deep an area is and applies the gradient based on the measured depth. The ‘Thickness’ is calculated by a ray being fired inward from the first surface, until the next outward facing surface is encountered (the backside) or another surface is encountered in the case of surface intersections.”

Am curious, what’s the Mograph way?


Can you provide a description of the object (non-parametric) and how you would measure it’s thickness. Is the thickness uniform? If so, you can measure the distance between points using two point nodes and a distance node.


I think that might work if the object is regularly shaped, but for something else one would have to take a lot of samples. Probably my description is vague. It would be something like a fresnel shader, but instead of being driven by the angle of incidence it would be driven by thickness (as in the description above in the Modo help). Some kind of ray tracing solution.

At any rate this is getting above my pay grade, as what I need isn’t animated, probably the easiest thing to do is bake the Modo gradient to a texture map which I can use in Cinema.


PM me a link to the model and I’ll provide you with the vertex map.


This is a little xpresso setup i did for fun. I’m afraid it’s not what you looking for but maybe it’s good place to start. It only uses one ray per vertex, but with more interpolated rays it would give decent results.


That’s really cool! Great way for me to learn some expresso. Thanks. :bowdown:


You’re welcome. Xpresso is fun when you get it.
To be honest it’s not my original idea, it came from very talented guy, Paul Smith, he is kind of softimage ICE guru. This is his tutorial from which i get this idea.

You can translate majority of his tutorials to xpresso, but when you compare both ICE and xpresso it become clear that “our” system is quite limited and painfully slow.


That is why I have pretty much ditched xpresso for python.

I still build out “tests” in xpresso so that I can see how it works, but then I translate that into python, which is generally faster…especially when dealing with iterations over points.


I think this is kind of answer to your request.
This guy is on fire!


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.