Sub topic 14
Applying the Baked Maps in a Material
This chapter assumes you have already baked a tangent-space normal map and an ambient occlusion (AO) map from the high-poly mesh onto the low-poly mesh's UVs, and saved both as images. You should be comfortable with the Shader Editor, node links, and the difference between color data and non-color data. Here you will wire the maps into the low-poly material and check that the result is correct.
What the material needs
The two maps do different jobs, so they connect to different places.
- The normal map changes the shading normal. It connects through a Normal Map node to the Normal input of the Principled BSDF.
- The AO map darkens crevices. It is not a normal input and has no dedicated Principled BSDF socket. You multiply it into the base color, or use it as a separate output for an engine to consume.
Both images must use the Non-Color color space. Blender then reads the pixel values as raw numbers. If an image is set to sRGB, Blender applies a color transform to the pixels, which bends the stored vectors and gives wrong lighting.
Connecting the normal map
Follow these steps in the Shader Editor with the low-poly object selected.
- Add an Image Texture node and load
Asset_normal.png. - Set its color space to Non-Color.
- Add a Normal Map node (Add > Vector > Normal Map).
- Set the Normal Map node's space to Tangent Space. This matches how you baked it.
- Link the image's Color output to the Normal Map node's Color input.
- Link the Normal Map node's Normal output to the Normal input of the Principled BSDF.
Do not connect the image directly to the BSDF Normal input. The raw image stores vectors packed into the 0 to 1 color range. The Normal Map node unpacks them into real directions and converts them from tangent space into the space the shader uses.
The Normal Map node also has a Strength value and a UV Map field. Leave Strength at 1.0 while you check the bake, because any other value hides problems. If the object has more than one UV map, set the node's UV Map field to the one you baked into. With the field empty, Blender uses the active UV map for rendering, which may not be the one you baked.
You can build the same links with Python. This script reuses the objects and image names from the earlier bake scripts.
import bpy
mat = bpy.data.objects["Asset_low"].active_material
nodes = mat.node_tree.nodes
links = mat.node_tree.links
normal_tex = nodes.new('ShaderNodeTexImage')
normal_tex.image = bpy.data.images["Asset_normal"]
normal_tex.image.colorspace_settings.name = 'Non-Color'
normal_map = nodes.new('ShaderNodeNormalMap')
normal_map.space = 'TANGENT'
bsdf = nodes.get("Principled BSDF")
links.new(normal_tex.outputs['Color'], normal_map.inputs['Color'])
links.new(normal_map.outputs['Normal'], bsdf.inputs['Normal'])Connecting the AO map
The AO map stores a grayscale value for how much light each point can receive. White is fully open and black is fully blocked. To use it inside Blender, multiply it with the base color so crevices get darker.
- Add a second Image Texture node and load
Asset_ao.png. - Set its color space to Non-Color.
- Add a Mix node (Add > Color > Mix) and set its blend mode to Multiply.
- Link your base color (a color value or a color texture) to the first color input.
- Link the AO image's Color output to the second color input.
- Set the Factor to 1.0.
- Link the Mix node's Result output to the Principled BSDF Base Color.
A Multiply blend with a white pixel leaves the color unchanged. A gray pixel darkens it in proportion. That is the behavior you want from AO.
import bpy
mat = bpy.data.objects["Asset_low"].active_material
nodes = mat.node_tree.nodes
links = mat.node_tree.links
ao_tex = nodes.new('ShaderNodeTexImage')
ao_tex.image = bpy.data.images["Asset_ao"]
ao_tex.image.colorspace_settings.name = 'Non-Color'
mix = nodes.new('ShaderNodeMix')
mix.data_type = 'RGBA'
mix.blend_type = 'MULTIPLY'
mix.inputs['Factor'].default_value = 1.0
mix.inputs['A'].default_value = (0.8, 0.8, 0.8, 1.0)
bsdf = nodes.get("Principled BSDF")
links.new(ao_tex.outputs['Color'], mix.inputs['B'])
links.new(mix.outputs['Result'], bsdf.inputs['Base Color'])In this script the A input holds a flat gray base color. If you have a color texture, link it to A instead.
Checking the result
Switch the viewport to Material Preview or Rendered mode, and add a light that moves across the surface. A correct normal map shows detail that responds to the light direction. Rotate the light and watch the highlights shift. Flat shading that never changes means the normal map is not connected or its strength is zero.
Compare the low-poly mesh with the high-poly mesh side by side under the same light. Check these points:
- Large forms should match in shading, such as panel edges, rivets, and grooves.
- Bevels should read as highlights on the correct side, with no flipped bright and dark edges.
- Seams in the UV layout should not show as visible lines.
- AO shadows should sit in the same crevices as on the sculpt.
Common wiring mistakes
| Symptom | Likely cause | Fix |
|---|---|---|
| Surface looks pale, washed out, or lumpy | Normal image set to sRGB | Set the image to Non-Color |
| Whole surface looks uniformly tilted | Image connected straight to BSDF Normal | Add a Normal Map node between them |
| Details look inverted, with bumps reading as dents | Y convention differs from the engine or tool | Flip the green channel or change the convention |
| AO has no visible effect | Mix factor is 0, or AO is not linked to the color path | Set Factor to 1.0 and check the links |
| Detail looks wrong only after modifying the mesh | UVs or tangents changed after the bake | Rebake with the final mesh and UVs |
| Shading is correct in Cycles but odd in another engine | Different tangent basis or Y convention | Match the engine's convention, covered in a later chapter |
Keeping the images from being lost
Baked images that are only in memory disappear when you close the file. The bake scripts saved them to disk with img.save(). If you baked by hand, save each image with Image > Save As in the Image Editor, or pack it into the .blend file with Image > Pack. A packed image survives, but it increases the file size.
If you reload the file and the textures appear black or pink, the image path is probably broken. Use File > External Data > Find Missing Files, or re-link the image path in the Image Texture node.
Exercise
You connect Asset_normal.png straight from an Image Texture node into the Principled BSDF Normal input, with the image set to Non-Color. The low-poly mesh looks wrongly shaded. What is missing, and which setting on that missing node must match how you baked?
Show answer
A Normal Map node is missing between the image and the BSDF. It unpacks the color values into real vectors and converts them into the shader's space. Its space setting must be Tangent Space, because the map was baked in tangent space.
Exercise
You multiply the AO image into the base color, but the model looks unchanged. The Mix node is set to Multiply and the AO image is linked to input B. Name two settings you should check.
Show answer
Check that the Mix node's Factor is 1.0, because a factor of 0 passes through only input A. Also check that the AO image actually contains gray values and not all white, and that the Mix output is linked to the BSDF Base Color.