Shader node to get z value 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
Personally, I would create a 'Sea Level' object and extract the Z of its Object Space like this:



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