Sub topic 8
Cycles Bake Panel Overview
This chapter walks through the Bake panel in Cycles. It assumes you can navigate Blender, work in Edit Mode, edit materials in the Shader Editor, and unwrap a mesh with seams. It also assumes you know the difference between polygon count and shading normals. Later chapters cover the Selected to Active workflow, cage settings, and the bakes themselves. Here the goal is to know where each control lives, what it does, and which defaults can cause trouble.
Where the panel lives
Baking is a Cycles feature. EEVEE has no bake operator, so the panel does not appear until you switch the render engine.
- Open the Properties editor and go to the Render tab.
- Set Render Engine to Cycles.
- Scroll down and expand the Bake panel.
The panel appears only on the Render tab. If you cannot find it, check the engine first. A Bake button that does nothing is usually a sign of a different problem, covered in the last section.
The same settings are available from Python as bpy.context.scene.render.bake. The bake type itself is not stored there. It is passed to the operator: bpy.ops.object.bake(type='NORMAL').
The panel at a glance
The panel has one button, one type selector, and several sub-panels. The layout below follows Blender 3.x and 4.x. Labels shift slightly between versions.
| Control | What it sets | Python property |
|---|---|---|
| Bake Type | Which data to bake (Normal, Ambient Occlusion, Combined, and so on) | `type=` argument of `bpy.ops.object.bake` |
| Selected to Active | Bake from the selected objects onto the active object | `render.bake.use_selected_to_active` |
| Cage / Extrusion | How far the projection surface sits above the low-poly mesh | `render.bake.use_cage`, `render.bake.cage_extrusion` |
| Max Ray Distance | How far a ray may travel before it counts as a miss | `render.bake.max_ray_distance` |
| Normal Space | Tangent or Object space for normal bakes | `render.bake.normal_space` |
| Swizzle (R, G, B) | Which axis each color channel stores | `render.bake.normal_r`, `normal_g`, `normal_b` |
| Margin Type and Size | How far baked pixels extend past UV islands | `render.bake.margin_type`, `render.bake.margin` |
| Clear Image | Wipe the target image before baking | `render.bake.use_clear` |
Bake Type
The Bake Type menu decides what the baker writes into the image. For this tutorial only two entries matter.
- Normal stores the direction of the high-poly surface relative to the low-poly surface.
- Ambient Occlusion stores how much each point is blocked from ambient light by nearby geometry.
The other entries are Combined, Shadow, Position, UV, Emit, Environment, Diffuse, Glossy, and Transmission. Combined, Diffuse, Glossy, and Transmission expose an Influence sub-panel. It lets you include or exclude Direct, Indirect, and Color contributions. Normal and AO do not use it.
Bake Type is a per-bake choice. Normal and AO need separate bakes into separate images. The Bake button never produces both at once.
Selected to Active and the projection controls
Selected to Active tells the baker to read from other selected objects and write onto the active object. This is the high-to-low setup. Without it, the baker samples the active object's own surface. With a high-poly sculpt and a low-poly mesh, that would bake nothing useful.
When you enable it, two controls appear:
- Cage and Extrusion. Extrusion pushes the projection surface outward along the low-poly normals. Rays start from that pushed-out surface and travel inward. Set it high enough to clear the high-poly mesh everywhere, but not so high that rays catch unrelated geometry.
- Max Ray Distance. This limits how far a ray travels. A value of
0.0means unlimited. A small nonzero value reduces false hits from distant parts of the model.
Extrusion and max ray distance work together. Chapter 10 treats them in full. For now, remember that both are measured in scene units, so they depend on the size of your model.
Normal Space and swizzle
The Normal bake type exposes two extra settings.
- Space: Tangent or Object. Tangent space is the standard choice for game assets because it stays valid when the mesh deforms or rotates. Object space is useful for static meshes and for debugging.
- Swizzle: The R, G, and B menus default to +X, +Y, and +Z. This matches the OpenGL convention, where green points up. Engines that use the DirectX convention need -Y in the G channel. A later chapter on normal conventions covers this.
A mismatch here does not cause an error. The map bakes without complaint and the lighting looks subtly wrong, with bumps appearing to be dents on one axis.
Output settings
The Output sub-panel controls where the result goes.
- Target: Image Textures writes to the active Image Texture node's image. This is the usual setting. Vertex Colors writes into a color attribute instead.
- Margin Type: Adjacent Faces or Extend. Adjacent Faces fills the gap using neighboring surface data. Extend copies the island's edge pixels outward.
- Margin Size: The number of pixels to add around each island. The default is 16 px, which suits 2048 px maps. Smaller maps need less.
- Clear Image: On by default. Disable it only when you deliberately bake several passes into one image.
The active image node decides the target
The baker does not pick an image from a setting in the Bake panel. It writes to whichever Image Texture node is active in the low-poly object's material. If no image node is active, or the node has no image, the bake fails with an error.
import bpy
low = bpy.data.objects["Asset_low"]
mat = low.active_material
mat.use_nodes = True
nodes = mat.node_tree.nodes
img = bpy.data.images.new("Asset_bake_target", 2048, 2048)
img.colorspace_settings.name = 'Non-Color'
tex = nodes.new('ShaderNodeTexImage')
tex.image = img
nodes.active = texThe last line is the important one. Selecting a node by clicking it in the editor makes it active. In a script you set nodes.active yourself. The node does not need to be connected to anything.
Checking the panel before every bake
A short routine catches most failed bakes.
- The render engine is Cycles.
- The Bake Type matches the map you want.
- Selected to Active is enabled, and the low-poly mesh is the active object with the high-poly mesh also selected.
- Extrusion and Max Ray Distance suit the model's scale.
- Normal Space and swizzle match your target engine.
- The low-poly material has an active Image Texture node with the correct image.
- The image has the right color space. Data maps use Non-Color.
The diagram shows how these pieces feed the bake operator.
Common errors at this stage
The messages below appear in the status bar or the Info editor.
| Symptom | Likely cause | Fix |
|---|---|---|
| No Bake panel visible | Render engine is EEVEE or Workbench | Switch to Cycles |
| "No active image found in material" | No Image Texture node is active in the low-poly material | Add the node, assign an image, and click it |
| "No valid selected objects" or nothing bakes | Selected to Active is on but only one object is selected | Select the high-poly first, then the low-poly last so it is active |
| Image stays blank or black | Image saved before baking, or Clear Image wiped a previous pass | Bake first, then save |
| Bake works but looks wrong in other software | Swizzle or color space mismatch | Check the Normal Space, G channel, and Non-Color setting |
Note the unsaved-image trap. A generated image exists only in memory until you save it. If you close Blender without saving, the baked pixels are lost.
Exercise
You enable Selected to Active, select both meshes with the low-poly mesh active, and press Bake. Blender reports that there is no active image in the material. List the two things you must check on the low-poly material, and say why the Bake panel itself cannot fix this.
Show answer
First, the material must contain an Image Texture node with an image assigned. Second, that node must be the active node, which you set by clicking it in the Shader Editor (or setting nodes.active in Python). The Bake panel has no image selector. The baker always writes into the active Image Texture node of the active object's material, so the fix lives in the node tree.
Exercise
A teammate bakes a normal map in Blender with default swizzle settings, then imports it into an engine that uses the DirectX convention. Bumps look like dents along the vertical axis. Which Bake panel setting would you change, and to what?
Show answer
Set the G channel of the Swizzle option to -Y so the green channel is inverted, then bake again. Alternatively, invert the green channel in an image editor.