Height and Ambient Occlusion Maps with the Principled_Baker
The free
Principled_Baker Blender add-on can facilitate the exporting of PBR texture maps from Blender by exporting the inputs of the Principled BSDF Shader. It can even combine maps, placing the height map in the alpha channel of the normal map, and merging the emission, roughness, ambient occlusion and metallic maps to form the parameter map. However, the Principled BDSF Shader does not have inputs for a height map or an ambient occlusion map. So, how does one generate the diffuse, normal and parameter maps needed for Trainz 2019?
The solution is to make three passed with the Principled_Baker: (1) to output the diffuse (albedo) map, (2) to output the normal map with the height map in the normal’s alpha channel and (3) to output and combine the emission, roughness, ambient occlusion and metallic maps into the parameter map. The reason three passes are needed is that, in addition to the diffuse (albedo) map, only the Principled BSDF Shader base color input can output the height map and the ambient occlusion map, and only one at a time.
Here I will use the
Rustic Brick Wall – PBR0314 texture available for free at Texture.com.
The texture set is comprised of an albedo map, height and normal maps, and roughness and ambient occlusion (ao) maps. Since there are no emission or metallic maps, but they are still need to generate the parameter map, the slider settings of the Principled BSDF Shader slider can be used. Because the brick wall is non-emissive and non-metallic the sliders are set to 0.000 to produce a black map.
Diffuse:
1. The albedo map is connected to the Base Color input of the Principled BSDF Shader.
2. Only the Color map is selected for output.
3. Value Differences is not checked, as slider value will not be be outputted.
4. Connected Inputs is selected so the albedo map will be outputted.
5. For the diffuse map an alpha channel is not needed so the map type is set to RGB.
6. Since the parameter map is not going to be out putted, this is left unchecked. (I have the parameter and the normal plus height maps set as part of my Startup File settings (File Menu > Defaults > Save Startup File.)
7. Since the Normal Plus Height map is not going to be generated, this is also left unchecked.
8. The outputted diffuse file.
Normal Plus Height:
1. The height map is connected to the Base Color input of the Principled BSDF Shader.
2. Both Color (height) and Normal maps are selected for output.
3. Value Differences is not checked as slider value will not be outputted. Connected Inputs is selected so the albedo (height) and normal maps will be outputted.
4. RGBA is selected as the map type as an alpha channel is needed for the height information.
5. The Normal plus Height combination is selected.
6. The normal map is selected for the R, G and B channels and the Color (height) map for the alpha channel.
7. Preliminary testing indicated that height map needed to be darkened to reproduce results similar to the original map. This can be achieved by adding a Gamma Node and then increasing the Gamma value (e.g., 1.5).
8. The outputted height, normal and normal plus height files.
Parameter:
1. The ambient occlusion map is connected to the Base Color input of the Principled BSDF Shader.
2. The color (ambient occlusion), metallic, roughness and emission maps are selected for output.
3. Value Differences and the Connected Inputs are both selected since the metallic and emission maps will depend on slider settings and the ambient occlusion and roughness maps will depend on Connected Inputs.
4. RGBA is selected as the map type because an alpha channel is needed for the metallic information.
5. The Parameter combination is selected (Normal plus Height combination is deselected).
6. Emission = red channel, roughness = green channel, ambient occlusion = blue channel and metallic = alpha channel.
7. Preliminary testing indicated that ambient occlusion map needed to be darkened to reproduce the original map. Again, this can be achieved by adding a Gamma Node and then increasing the Gamma value (e.g., 2.0).
8. The outputted emission, roughness, ambient occlusion, metallic and parameter files.
Once the diffuse, normal (normal plus height), and parameter (emission, roughness, ambient occlusion and metallic) maps have been generated they are added back to the Blender file so that the .fbx file can be generated.
The diffuse, normal, parameter and .fbx files imported into Trainz 2019 to generate an asset.
Cayden