2
$\begingroup$

I am putting together a coastal scene. In order to make the rocks close to the water shiny from the water, I would like to set the roughness as function of the height (z value). If all the rocks where single objects with unique location, I suppose it would be easily done. However, my landscape is a big 3D scanned object and I would like the reflection to change accross the mesh. Is there a node that achieves this?

Ludvig

$\endgroup$
3
$\begingroup$

Personally, I would create a 'Sea Level' object and extract the Z of its Object Space like this:

enter image description here

Now the Z output is a number; the height above/below sea level in Blender units. You can scale that number, map it to another range, put it through curves or a color ramp.. whatever you need. If you put this pair of nodes into a little group, you can quickly include it in any material

enter image description here

| improve this answer | |
$\endgroup$
2
$\begingroup$

Add a "Texture coordinate" node, and plug the "Generated" output into a "Separate XYZ" node.

The "Z" output will take values between 0 for the lowest point to 1 for the highest point.

Plug it into a "color ramp" or a "Map range" in order to fine-tune the output value.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.