Unlike Bump/Normal maps, Displacement maps (also known as Height maps) are not shading effects - they physically modify the geometry of a surface. They are used mostly for medium to large scale details and on surfaces that have large protrusions, for ex. a brick wall. In order for detail to be created based on a Displacement map, the mesh must be subdivided/tessellated so real geometry is created. This costs in longer render times and consumes considerable amounts of RAM.
One great thing about Displacement maps is that they are greyscale and can be painted by hand when necessary. They work the exact same way a Bump map works - white pushes up, black pushes down. In the same way Normal maps are baked, Displacement maps conserve high resolution detail which should be transferred on to a low resolution mesh.
Displacement maps produce different (in terms of quality) results based on the Bit Depth of the texture.
If if there is an opportunity to save a Displacement map as 32 bit floating point, than this is the best option one can have. 32 bit maps will store both positive and negative floating point values. Let's say we have a brick wall with 5cm depth. We bake it on to a plane which is positioned right in the middle of our wall depth wise, at 2.5cm and save it out as a 32 bit float EXR. If we then open up the image in a software capable of reading 32bit float and check what are supposed to be the highest and lowest points in our texture (top of the bricks and bottom of the grout in our example), we will see that the values are respectively +2.5 and -2.5.
When using properly baked 32 bit Displacement maps, displacement strength should be left at the default value of 1. Strength will act as a multiplier over the values that are already present in the Displacement map. If we use our 5cm brick wall as an example: 1cm * 5cm = 5cm. If we change the displacement strength to 2cm, we get 2cm * 5cm = 10cm - our brick wall won't have correct displacement, in fact it will have double depth. The greatest benefit of using 32 bit floating point Displacement maps is that we can reproduce exactly what we baked - no fiddling around with numbers to get it looking right.
It has become industry standard to store displacement information in the Red channel.
Photoshop can't read 32 bit floating point maps properly - everything bellow 0 and everything above 20 will be clipped.
This example demonstrates a Displacement map that uses floating point values. The black line in the graph represents a displaced plane which sits at 0cm. We are using VRayColor with 2.5 positive and negative values. As you can see, leaving the displacement Amount/Strength to 1cm will result in 2.5cm positive and 2.5cm negative deformation of the plane.
This is the second best option one can have. 16 bit Displacement maps cannot store information below 0 and above 1 and we need to use displacement strength to remap the information. If we want to reproduce our brick wall with a 16bit Displacement map, we have to take into account that our highest point (top of the bricks) needs to be 255 RGB (pure white) while our lowest point (bottom of grout) needs to be 0 RGB (pure black). If we now put 5cm into displacement strength we will have our brick wall with correct depth.
Correct depth is not enough, however. If you remember our brick wall had negative values as well as positive. At the moment it will stick 5cm out of where our plane is, while it actually needs go go 2.5cm out and -2.5cm back. Next chapter will discuss how we can account for this.
They work the exact same way as 16 bit, however they tend to produce ugly stepping artifacts.
16 bit (left) vs. 8 bit (right) Displacement map. You can see the stepping artifacts when using the 8 bit texture, clearly visible on the smoother bricks.
There are a two ways of working with Displacement maps in 3ds Max an V-Ray.
This method uses 3ds Max Displace modifier. We simply need to plug our Displacement map into the Map slot and adjust the Strength parameter if needed (with 16/8 bit maps).
When Displacement maps are baked, as mentioned, black will usually be a negative value, white will be a positive value and 0cm will be in the middle (50% grey). If you paint them on your own you might choose to use them differently (black can be at 0cm for example), but in most cases the aforementioned is true. This brings us back to our brick wall example and on to the question how to fix incorrect displacement with 16/8 bit maps.
The Displace modifier has an option called Luminance Center. Simply, it controls where does the 0cm, or ground level, lie between black and white (0-255 RGB). If set to 0.5 (the default) this will mean that 50% grey equals 0cm. If set to 1 it means that white will be 0cm and the geometry will go only back (all values will be negative). The opposite will be true if Luminance Center is set to 0. As we saw in our example, leaving Luminance Center disabled will result in our bricks having correct depth but incorrect position in space. To fix this we simply need to enable Luminance Center and leave it at the default value of 0.5. Now everything is correct and our bricks will go 2.5cm out and -2.5cm in.
By default Luminance Center is turned off and in this state the Displace modifier works in the same way as when Luminance Center is set to 0.
This method used VRayDisplacementMod modifier. The modifier offers quite a few options and methods for displacement. We will only look at the most common setup here:
Set Type to "3D mapping" (default).
Set Amount as you wish.
Set Shift to the halved negative of Amount - if Amount=5cm, then Shift=-2.5cm. This is effectively doing the same as setting the Luminance Center to 0.5 on a Displace modifier.
Edge length - usually default value of 4 is enough. Use lower values to achieve greater detail and higher values for quicker (but lower quality) renders. Mind that this is very heavy on RAM and render times, so use it wisely.
Tick "Keep continuity" if you have sharp corners on your base geometry.
These are the basic things that will usually be enough to control everything you need. For more info on individual parameters you can check the Chaosgroup help documents.
Here you can see how the Luminance Center and Shift value in VRayDisplacementMod work. The first image shows the default behavior of both Displace and VRayDisplacementMod (Luminance Center set to 0 is the same as turned off). The second shows how Displacement maps should be used, except if you intentionally set them up in a different way.Â
Why Luminance Center / Shift Value is so important? If you don't set it correctly, you will most likely end up with "inflated" or "deflated" geometry. Furthermore, Displacement is often times used on curved shapes as opposed to planes and things can start to look messy without taking into account where the Luminance Center should be. We can go back to our brick wall as an example:
You can see what happens with both corners when the Luminance Center is set at 1 (white) or 0 (black). When the center is set to mid-grey or 0.5, the bricks appear to look correct on the corners. You can still see some artifacts on the corners, edges are splitting. This is one of the drawbacks of using Displace modifier. VRayDisplacementMod can fix these by enabling "Keep Continuity". In best case scenario, such objects need to be unwrapped in order to eliminate artifacts.
Both the Displace and the VRayDisplacementMod modifiers have their pros and cons. In short, the Displace modifier should be used to save up RAM and render time, while VRayDisplacement should be used when quality is priority (mainly for closeups).
Displace Modifier
Pros:
RAM consumption is more easily controllable by setting up the subdivision level of the displaced surface
Immediate visual feedback in viewport
Renders kind of fast
Cons:
Can't get very detailed results as they require too many polygons
Can get occasional crashes while setting it up especially when the polycount goes into the millions
Edges can "break" where geometry has sharp edges (corners)
VRayDisplacementMod Modifier
Pros:
Best results in terms of detailing
Quite a few options for control over the quality
Cons:
Consumes a lot of RAM in certain scenarios (when used on very large surfaces for ex.)
Renders slow
Needs rendering for visual feedback
Normal maps aren't enough when it comes to surfaces that have large scale detail and protrusions/extrusions. Even if viewed from afar, a brick wall with only a Normal map won't look convincing.
Render Time: 10 min
Setup: VRayNormal map only
The Displace modifier requires pre-subdivision of the mesh. Usually this means meshes between the hundreds of thousands to the millions of polygons. Even though this might seem a lot, it renders faster and requires less RAM than VRayDisplacementMod.
Render Time: 16 min
Setup: Displace, 8mil polygon mesh
VRayDisplacementMod offers the best quality possible. A serious drawback, however, is that it also requires a lot of RAM and significantly slows down rendering. It should be used for close-ups and high end work.
Render Time: 22 min
Setup: VRayDisplacementMod, Edge length=4
Here are a few things you might want to know/consider when working with Displacement maps.
Often times you won't know the exact depth of a Displacement map. This will be for example when you bake 16/8 bit maps, scan textures (depending on the scanner you might actually get that info) or simply download textures from the web. There is a fairly easy way to figure out the depth if you have a Normal map:
Make a new scene
Set Background colour in the Environment tab ("8" for shortcut) to White
Make a plane from top view. Make sure it has correct mapping on it (the one that you will be using in your scene).
Apply your materiel with the Normal map
Apply a VRayDisplacementMod on the plane with the Displacement map
Add a VRayBumpNormals pass
Disable the displacement and render from top view - only the Normal map needs to be visible in the VRayBumpNormals pass
Save the render in the frame buffer for comparison
Disable the the Bump slot on the material (so the Normal map won't render) and enable the VRayDisplacementMod
Render again and tweak the Amount of the Displacement until it matches the Normal map
When working with architecture we are working with real size objects and therefore use real size units. Our textures are derived from the real world and they should have realistic sizes when loaded into our 3D package. We know that for example an English brick is 21.5 x 10.25 x 6.5cm. It will be controversial to have a square brick wall texture made out of 20x40 bricks and use 50x50cm as texture size, while in fact it must be more than 400x400cm (if you do some simple calculations). This is in architecture and is what helps bring realism to our renderings.
So, before setting up any displacement, it's good to know the real-world size of your texture. If you don't, you can make an educated guess. If you download textures from the web, they might have size information (and sometimes even depth information). Libraries for scanned surfaces like Megascans proved us with both the size of the texture/scanned surface and the depth of the scanned surface.
Let's say that we have all that information and use a soil texture. Soil is something that we can hardly "guess" the size of. We know that our scanned patch is 100x100cm and it has a depth of 2cm. All is fine if we setup our texture size and Displacement amount using these values. However, as mentioned soil isn't something that you can "guess" the size of. In a future project it turns out that if we set up our Soil texture size to 50x50cm instead, it looks better for our needs.
The tricky part here is that we have to remember that we've setup real-world size Displacement. Now when we use a halved version of our texture we need to also half the Amount if Displacement and 2cm will become 1cm. Otherwise, we will get very deep crevasses on a surface that is now too tiny to have them. In the end, the thing to remember is to always change Displacement Amount based on how you resize your textures - larger sizes will need greater Amount and the opposite for smaller sizes.
Scaling objects will also affect Displacement. Let's say that instead of changing the size of our soil, we simply scale down our object to 50% of its original size. This will also scale down the texture on the model (without affecting the material) and the Displacement (this, in fact, is only true for Displace modifier. VRayDisplacementMod is not affected by scaling and will always work with correct real-world scale). Here, you won't have to change Displacement Amount as you've effectively scaled it down with the whole object. However, this method is inadvisable - every scaling in 3ds Max performed at object level and with the Scale tool will bend laws of physics. All modifier effects will be scaled in parallel so if further down the line you want to do some physical changes through modifiers, numbers simply won't do the math correctly. Animations will also be affected from this. This means that if you put 2cm in the Displacement Amount it will actually equal 1cm in our particular case.
Keeping the above in mind, you might still want to scale down your object along with its UVs (if unwrapped). To correct the scaling process, the XFrom needs to be reset. Afterwards your Displacement should work - 5cm will equal 5cm. However, as you've scaled your UVs, your texture will also look scaled down on your model and again you will need to adjust the Displacemet Amount to account for this change.
Sometimes you might want to combine Normal/Bump and Displacement maps. In fact, for high-end renders, this is most often the case. Normal maps are used to reproduce the fine details, while Displacement maps are used for the large scale details. In production, Normal maps are more or less mandatory while Displacement maps are used carefully where necessary.
Displacement only (left) can't look too detailed even if the geometry is super dense, which it shouldn't (if you don't want to crash your system or the render farm). When you combine it with a Normal map (right) you can get all that fine detail that was missing before. The Normal map will also help with adding detail to places where the subdivision of the surface wasn't enough to show correct displacement.
Displacement (also called Height) maps look similar to Bump maps and are used for medium to large scale details. They modify the surface appearance physically.
Use 32bit Displacement maps when possible for best results. Avoid using 8bit maps as they produce artifacts.
Use Displace modifier and subdivide your mesh for faster rendering and lower RAM consumption.
Use VRayDisplacementMod when you have close-ups / really need to see the detail.
Remember to set Luminance Center to 0.5 in the Displacement or the Shift to the halved negative of the Amount in VRayDisplacementMod.
When changing real-world sizes of textures you need to also change the Displacement Amount accordingly.
Using a combination of both Bump/Normal and Displacement maps will often give the best results in terms of detail and quality.