# Understanding Displacement Maps

I am having a problem understanding displacement maps. I'm starting to think that I don't understand them at all.

Clarifying My Understanding

My understanding (which might be completely wrong), is that a displacement map is a gray-scale image whereby a value of 0.5 produces no displacement, >0.5 produces displacement in the positive direction, and <0.5 produces displacement in the negative direction. This, however, does not seem to match my actual observations in Blender.

I am using a displacement map within Cycles, plugging it into the Displacement socket on the Material Output node (I am also using the new experimental adaptive subdivision and micro-vertex displacement). I note that a value of 0.5 actually produces a displacement in the positive direction, causing the whole mesh to jump up slightly, as well as creating the peaks and valleys that you would expect for >0.5 and <0.5 values respectively.

This affects my entire understanding of displacement maps. Why is this happening? Why is a value of exactly 0.5 creating displacement? Further, how are you supposed to arrange and line up objects in your scene when, in rendered view, the displacement maps will push them out of position, even if those maps are only supposed to create displacement in specific areas.

The Problem in Practice

This is the problem I am having at the moment. I have a plane which is supposed to be a snowy field, and I am using a displacement map to give some depth to the snow. In rendered view, my plane jumps up significantly. This is what lead me to investigate my understanding of displacement maps, and to this question.

Additionally, what is the correct way to increase and decrease the strength of a displacement map? At the moment, I will run them through a Math node set to multiply, however, as you might imagine, this exaggerates the issue that I am complaining about above.

To be clear, however, I am not using a math node when experiencing the "jump up" for 0.5 values. This is not the source of my problem, but another aspect to it.

The Displacement input of the Material Output node treats 0.0 as no displacement - rather than 0.5 as you expect. If you are using a Gray-scale image for your displacement you will need to adjust the values (0.0 to 1.0) to be centred around 0.0 rather than 0.5 and youcan achieve this by simply subtracting 0.5 using a Math node. You may also want to feed the output of that through a Multiply node so that you can adjust the magnitude of the displacement.

• If that's true, how can you ever have negative displacement? You would have to have a value of <1 that isn't possible....? Oct 31, 2016 at 9:20
• Not sure I understand - "<1"...? Do you mean "<0"? Oct 31, 2016 at 11:03
• My understanding of displacement is that it's aling the norml of the surface at that point and that 0.0 (when using the Material Output Displacement node) is for no displacement. Using an image as the source of the displacement will only range from 0.0 to 1.0 for varying shades of grey from Black to White and so if you require 0.5 to represent no displacement you'll need to pass the output of your Image Texture node through Maths nodes or similar to map them to the values that the Displacement input requires. This is purely from a point of view of Cycles Material Nodes. Oct 31, 2016 at 11:07
• Thanks. I think I understand that bit. I guess my question is, if the Cycles Material Output Displacement socket only understand 0 to 1 (i.e. 0=do nothing 1=displace maximum upwards), how can you ever displace downwards? Following what you say there, about using the Math node, all the 0.5s in my image would go to 0 (great, no displacement, just like I wanted). However, everything<0.5 in my image would go <0. Does the Material Output Node Displacement Socket understand <0? Oct 31, 2016 at 11:16
• My understanding was that it did support negative displacement - I've not got thelatest version installed so using 2.77 in "experimental" mode and apart from a bit of glitchiness (where I have to change the Displacement method to get it to refresh the displacement) it is handling negative displacement (ie less than zero) as described. Oct 31, 2016 at 11:51

# For Blender 2.83

The Material Output node takes a vector as an input. This vector is best supplied by a Displacement node. The displacement map (in this case a generated 10x10 black and white checkerboard pattern) goes in Height, Midlevel sets where zero displacement occurs, it is in the texture input units. Scale sets the amount of displacement, it is in terms of Blender Units. In the attached example image, there is a white 7x7 plane centered at the origin, and 4 red 1 unit square cubes sitting with their bases on the XY plane. The white plane has a displacement map texture whose input runs from 0 to 1, Midlevel is 0.5 and Scale is 2. This means the white square is displaced from $$( 0 - \textrm{Midlevel} ) * \textrm{Scale} = -1 \textrm{units}$$ to $$( 1 - \textrm{Midlevel} ) * \textrm{Scale} = +1 \textrm{units}$$