Issue: Imagine that you have enormous meshes in your scenes that you have UV-unwrapped as cleanly as possible. You want to bring these meshes into Unreal Engine and, to optimize performance, you want to bake displacement details into a normal texture. The challenge with large assets is that they occupy a significant amount of UV space. As a result, when attempting to bake detailed normal maps, achieving this goal becomes impossible.
Let’s take a look at the cave mesh in the following screenshot. You can tell that the texel density is too low to bake any displacement into the normal map.
No displacement modifier, just the mesh itself.
Now, let’s take a closer look at the second mesh. This time, I’ll be modifying the mesh with a displacement modifier. It’s important to note that this mesh already has an ideal number of polygons, which are further multiplied (4 times, to be specific) by a ‘Multires’ modifier, and then, as the final modifier, the displacement is pushed to the stack. Let’s check the amount of the details we get:
Low/Mid Mesh + Multires (4*Subdivision) + Displacement
The details are barely visible. And we haven’t even baked the details yet. (Remember: We lose some of the subtle details during the bake.)
If we were going to use this cave only in Blender, we could go to the UV editor, select all the islands, and scale them up, so the displacement modifier (Coordinates: UV, Direction: Normal) would have more pixel density to work with. Or we could set its texel density to something like 2K, which would give us the desired result.
But here comes the problem: When you increase the texel density on big meshes, they go out of the UV-space boundaries.
This wouldn’t be a problem at all if we didn’t need to bake anything. In modern games, many assets go out of their UV space, but they use seamless PBR textures, so it doesn’t matter how big the UV islands are; if they are going out of the UV-space, etc. (Ignoring the performance cost, since it’s not the topic here. — You could also assign multiple UVs to different parts of the meshes, (Multiple UV sets in one mesh is supported in UE5.), but it’s still an extra setup to do, and a time consuming task considering now you’d need to re-unwrap many parts of the mesh and strategically think where you could separate the UVs so they are not so obvious to the player.)
But when you bake something, your mesh is locked into those seams and if your UVs go out of the UV space, they won’t display its normal details properly because their UV island placement will not match the normal texture itself. Even if we tried to pack the UVs, we would never be able to fit enormous meshes’ UVs into a 2K/4k, or even 8K UV space.
Your advertisement can be placed here for $200 permanently. Suggested resolutions: 1800x663 or 1400x1400. Contact us.
Adjusting displacement texture repetition, and modifying contrast/brightness values.
If you go to your ‘Texture’ properties:
You’ll see that underneath the mapping section, there are values for repetition. By default, these values are set to 1. The higher the numbers here, the more repetitive the texture becomes.
For clarity, I’ll replace my displacement texture with a brick displacement texture. When I set my repetition values to 8x8 and adjust the brightness/contrast of my displacement texture, this is what we get:
Finally, we can see some displacement. Nothing was changed in the UVs; only the repetition value was adjusted.
If I increase the repetition value to something even higher, such as 24x24:
Now we’re getting the desired results. Again, nothing in the UVs are adjusted. Still the same UVs.
How do we adjust brightness/contrast of a displacement texture?
If we scroll down in the ‘Texture’ properties tab, we’ll see an area called ‘Colors.’ Here we get access to these values. Since displacement textures are grayscale, adjusting their brightness and contrast will give us the look we’re after.
I switched back to my cave displacement texture, then baked the details I needed into my normal map. Here’s the baked result:
Remember that displacement maps require a lot of polygons to be effective. In addition to that, make sure that you UV-unwrap your meshes cleanly. There should be enough margin/empty space between your UV islands; otherwise, they’ll interfere with each other, which will end up in messed up normal bakes, which I talked about in detail here. And as the last thing, do not forget to apply your displacement map to your mesh, otherwise, you’ll get no result if you try to bake it without applying it. I believe in such cases Blender throws the error of ‘Multires object requires multidata’ or something in that regard. And lastly, turn Multires’s level viewport value to 0 before you bake. And that’s all. If you enjoyed this tutorial and found it useful, consider supporting me on Patreon so I can dedicate more time to writing these tutorials.