Why is my color map gradient (by node xyz value) working for x and y but not z? very new to blender and not an expert. Coming from engineering field and want to learn more about rendering CFD/model results in Blender.

Right now I am struggling with adding a coloramp to a surface. I want the color to be based on the x/y/z values of the node coordinates. For example if I want to plot a water surface, I want it to be colored by z-value.

What I've done so far is:


Created a plane mesh
Added displacement modifier to the mesh to give it some bumpiness (z-values)
In the shading editor, I added a Texture Coordinates node -> mapping node -> separate xyz node -> coloramp node -> principle bdsf node -> material output node


My node shading node set up is below.

Right now, when I use separate xyz node to color by x it works fine, and also by y. But if I choose z I get no coloring even though there is definitely z values?





Can anyone explain to me why this isn't working and how to get it working by coloring the surface using a colormap based on z values of the nodes?

Thanks
I think that you have just to remap your values, it should work that way. So on the Z axis displacement is not maybe enough to be visualized properly. I would suggest you to try something like this (if you want to keep the actual colors) or to just move the sliders of your color ramp indices towards the center (narrow their distance).