3

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

2 Answers2

5

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

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
2

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.

Gorgious
  • 30,723
  • 2
  • 44
  • 101