Sub topic 14
Applying Baked Maps in a Material
This chapter assumes you can navigate Blender, create materials, use the Shader Editor, and unwrap a mesh. You should also have baked Asset_normal and Asset_ao images from the previous steps.
Connect the tangent-space normal map
A normal map stores surface-direction data. It changes how light reacts to the low-poly surface without adding polygons. Set the normal image to Non-Color because its RGB values are data, not displayed color.
Create this node chain:
Image Texture (Asset_normal) → Normal Map → Principled BSDF NormalSet the Normal Map node's Space to Tangent. Tangent space follows the low-poly mesh's UVs, so the map must use the same UV layout that was active during baking.
The Image Texture node must use the baked image. If you create a new Image Texture node, select Asset_normal in its image field. Do not connect the image directly to the Principled BSDF Normal input. The Normal Map node converts the stored RGB values into a usable surface normal.
Add ambient occlusion
An ambient occlusion map stores how strongly nearby surfaces block ambient light. White areas receive full ambient light. Dark areas represent creases, contact points, or cavities.
Use the AO image as a mask. Set it to Non-Color, then multiply it with the base color before connecting the result to Base Color. A Mix Color or MixRGB node can perform this operation. Set its blend mode to Multiply and its factor to 1.0.
Keep the effect moderate. A completely black AO map can make the material look dirty, while multiplying AO into a metallic or emissive material may produce an unwanted result. Some game engines use AO in a separate material input instead, so follow the target engine's material convention.
Automate the node setup
This script adds both maps to an existing low-poly material. It preserves an existing base-color connection when one is present.
import bpy
obj = bpy.data.objects["Asset_low"]
mat = obj.active_material
if mat is None:
raise RuntimeError("Asset_low has no active material")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes.get("Principled BSDF")
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"
links.new(normal_tex.outputs["Color"], normal_map.inputs["Color"])
links.new(normal_map.outputs["Normal"], bsdf.inputs["Normal"])
ao_tex = nodes.new("ShaderNodeTexImage")
ao_tex.image = bpy.data.images["Asset_ao"]
ao_tex.image.colorspace_settings.name = "Non-Color"
multiply = nodes.new("ShaderNodeMixRGB")
multiply.blend_type = "MULTIPLY"
multiply.inputs[0].default_value = 1.0
base = bsdf.inputs["Base Color"]
if base.is_linked:
old_link = base.links[0]
links.new(old_link.from_socket, multiply.inputs[1])
links.remove(old_link)
else:
multiply.inputs[1].default_value = base.default_value
links.new(ao_tex.outputs["Color"], multiply.inputs[2])
links.new(multiply.outputs["Color"], base)Check the result
View the low-poly object under a moving light. The normal map should reveal detail that the silhouette does not contain. If the detail appears inverted, check the normal convention used by the target engine. If the AO appears colored, verify that its image texture uses Non-Color.
Exercise
Why must a tangent-space normal map pass through a Normal Map node before reaching the Principled BSDF?
Show answer
The node interprets the image's RGB data as tangent-space direction information and converts it into the surface normal expected by the shader.