How can I access displacement modifier z coordinates in the shader editor? I am trying to create a heatmap style of animation from a black and white image sequence.
So far I created a grid, applied the image sequence as a texture and then added a displacement modifier.
As long as I don't click 'apply' on the modifier, it updates with each frame -&gt; perfect. I also activated the options, that the mesh is updated in edit mode. However, somehow the texture coordinates node does not recognize the new z-positions, unless I click apply on the modifier. But then, it's not dynamic to the image sequence texture.
For the moment, I created a workaround by not choosing the &quot;generated&quot; texture coordinates, but the &quot;reflection&quot; option. However, this may ressemble the actual z- positions, but is not acurate enough for me as it also changes with the viewing angle.
Any suggestions?
Displacement modifier:

Current node setup:

&quot;Reflection&quot; heatmap:
Your modifier displaces the geometry by +/- 1000 units (I suggest setting the midlevel back to 0.5 by the way), but your color ramp only effectively differentiates colors in your geometry between 0 and 1 units.
You could also set the midlevel to 0, and set your plane origin to geometry so that the displacement only raises the geometry.
I'm saying that because you should use the &quot;Object&quot; output which Z coordinate will be negative if it is located under the object origin. That way you can deal with this information only by dividing the Z coordinate by the strength of your modifier. That will give you the full range of height of your mesh, normalized between 0 and 1, perfect for a color ramp.
In short : Use the object output, but move the origin of the object lower (or raise your geometry in edit mode) and plug a math node set to divide by [the same strength as your displace modifier] between the separate XYZ and the color ramp node.