Page MenuHome

Baking workflow revamp
Confirmed, HighPublicTO DO

Assigned To
None
Authored By
Dalai Felinto (dfelinto)
Aug 20 2019, 9:36 PM
Tokens
"Love" token, awarded by El_In."Love" token, awarded by cgeugene."Like" token, awarded by Serva."Love" token, awarded by Alaska."Love" token, awarded by Mike.Bailey."Love" token, awarded by Schamph."Love" token, awarded by mindinsomnia."Love" token, awarded by kenziemac130."Love" token, awarded by bnzs.

Description

(This design doc is work in progress)

Goal

Baking is hard to use and requires one map to be baked at a time. Each time configuring appropriate settings and selecting the right objects and shader nodes.

Blender should natively have a baking workflow that is more efficient and powerful.

Existing Work

Multiple add-ons exist to make this workflow easier.

A patch for object-based baking and long discussion about various other options is here:
D3203: Baking system overhaul: Move baking settings from render settings into BakePasses

Use Cases

  • Baking a set of maps for game assets.
    • Typically includes maps like base color, metallic, roughness, normal map, AO.
    • The assets may use complex procedural texture nodes, multiple blended shader nodes and multiple materials, all to be baked down to a single set of maps and material that the game engine understands.
    • Exporters like FBX or glTF would typically want to export this baked material representation.
    • Efficiently re-baking objects, inspecting the results in the viewport, and applying the same settings to other assets is important.
  • Baking to optimize rendering
    • Some part of a shading network may be baked down for more efficient rendering, either as a viewport approximation or final render. Maybe a complex procedural texture, static background or ray-traced AO/curvature.
    • Light maps may also be considered part of this, though I personally would not recommend to use them for Cycles or Eevee and not focus on this use case.
  • One-off bakes
    • Examples may be to create a base to start texture or vertex painting, to use in geometry nodes, etc.
    • The current workflow is reasonably well suited to this, but automatic creation of images or vertex color layers and preview of the result would be helpful.
    • Perhaps best integrated as an operator/tool in paint or edit modes.
  • Other
    • Light map baking for export: how important is this still in modern game engines?
    • Baking as a part of a geometry nodes network?
    • Baking to transfer attributes between objects: use Data Transfer modifier instead?
    • ... ?

Proposal

There is not a single workflow that is ideal for all uses cases. I suggest to have two workflows that I think will handle the most important ones well, and can work for others with some extra effort. The Bake panel in the scene render properties would be removed.

One-Off Bakes
  • New operator to quickly bake to images or attribute
  • Operator pops up a dialog, with choice for bake type and relevant settings
  • No settings stored in the scene. Only operator properties, remembered for the next operator execution
  • Operator creates new images or attribute if none exists, or bake to active one
  • Likely exposed in vertex, sculpt, texture paint mode, and in the vertex colors panel
  • No selected to active baking support here
Material Based Bakes
  • New Bake Texture shader node
    • Bake type and relevant settings
    • One bake type is an input socket with arbitrary shader nodes plugged in
    • Image or attribute to bake to
    • Bake/Clear button
  • New Material datablock settings
    • Bake panel in material properties shader node editor, visible when there are any Bake Texture nodes
    • Bake/Clear button for the entire material
    • Collection property for "selected to active" baking, no use of selection state.
    • Any other shared settings

With this system, it's possible to create a reusable shader node group for a baked material, or manually add a few Bake Texture nodes for specific cases.

A big advantage of this approach is that the baked result is also immediately previewable in the viewport and usable in the final render. No need to set up bake settings in one place, and a preview shader node setup in another place.

More details to be worked out

  • Likely need an Image socket type, to make shader node groups really reusable?
  • How to handle baking multiple materials into one, special material slot that all materials bake into?
    • Potentially confusing to have two ways to bake, using either this special slot or as part of regular material slot
  • Precise workflow to clear bakes and decide if baked/unbaked is show in viewport and render

Python API

We expect add-ons will continue to be needed for more advanced use cases and automation. Currently these use the Bake operator, but a lower level Python API function could be added, which does not rely on selection state, but rather accepts specific objects, materials, attributes, etc.

Missing Features

  • Metallic, Base Color and possibly other types
  • Packing bakes into specific channels, and multiple maps into one image or attribute

Event Timeline

Dalai Felinto (dfelinto) lowered the priority of this task from 90 to Normal.Aug 20 2019, 9:36 PM
Dalai Felinto (dfelinto) created this task.
Brecht Van Lommel (brecht) triaged this task as High priority.Jun 18 2020, 7:29 PM
Brecht Van Lommel (brecht) renamed this task from Batch baking pipeline I/O to Baking workflow revamp.Jan 12 2021, 5:31 PM
Brecht Van Lommel (brecht) updated the task description. (Show Details)

Please add Denoising.
It's a huge timesaver for Combined, Glossy(direct/indirect), Diffuse(Direct/Indirect), Ambient Occlusion and Shadow pass.