Unified detail mapping (UDM) is in this particular case, basically a reversed detail map. Usually the detail map is used for finer details as you get closer. UDM is the opposite. It helps to define big shapes viewed from the distance.
Since the close up detail is provided in the regular tiled textures, we need for big cliffs, rocks, trees, etc. bigger detail to define the shape better when viewed from the distance. The process is very easy, the only thing it requires some rearranging of the layers and some very simple math.
As you can see below the two images the first once is the same rock without and with the UDM.
First thing is to lay out the UV's for our low poly and make the tileable textures. Please lay out your UV's as you would custom paint your texture to it. We will need that for our UDM. The textures will be tileable though, so please be smart about where you put the texture seams.
From the sculpt done in Zbrush/Mudbox we have to bake out three different maps out of our sculpt:
For the AO map we need after it has been baked out to bring the value down to 128 since as the UDM it will be used as our diffuse texture and being white it will make our whole asset brighter, since we don't want that we need to adjust the value to 128.
Now that we have all the required maps baked out we need to put them all into one map and rearrange our layers. First create an empty texture with the same size as our bakes (in this case a 2048 x 2048 texture). Now we take the bakes and start splitting them up.
First we take our normal map bake and go into the layers. We need to take the red channel and the green channel and then put it into the green and alpha channel of the new texture created. You can also put additional diffuse detail textures and color them with the vertex coloring.
Next we take the AO map and put it into the red channel of the new texture. At last we take the gloss map and put it into the blue channel of the new texture.
Our map will look like this once all has been assigned.
Once we have our map done we need to save it out correctly. When you're saving it please name it always (name of texture)_detail.crytif. Save it out as a crytif and in the scroll down menu, choose MergeDetailMap_HighQ.
As for the size, a good size is a 512 x 512 texture for an asset that's 20m large. It's advised not to go higher than 512 x 512 since it's an uncompressed texture and a higher map will use up too much memory.
A super sharp texture is not needed as the tileable texture establishes that and the UDM establishes the shape.
Once we have all that done, we need to set up our shader in CRYENGINE and decide the right tiling ratio for our UDM.
Once we have our object in the editor we load in our tiling textures first and set out tiling for it. In this case it's 5 times in U and V.
Next we load in our UDM in the Detail map slot and turn on the detail mapping in our shader settings. Once that is done we need to apply some simple math.
To get the right tiling ratio we need to divide 1 by the number of the tiling of the tileable texture. In this case it's 1 divided by 5 which gives us the result of 0.2. We put that in the tiling value of U and V in the Detail map slot.
After that is done we set up our blend map as regular.
Adding some vertex coloring is also a great way to give some extra break up our tileable texture and make the whole object more interesting.
If everything went correctly we have our asset with the UDM and it looks like this.
There are two main settings in UDM which we can adjust:
Detail Bump 1 | Detail Bump 3 |
---|
Detail Diffuse 0 | Detail Diffuse 0.75 |
---|