Page MenuHome

Displacement baking with Cycles
Confirmed, HighPublicTO DO

Assigned To
None
Authored By
Dalai Felinto (dfelinto)
Aug 20 2019, 9:32 PM
Tokens
"Party Time" token, awarded by sam_vh."Love" token, awarded by aliasguru."Love" token, awarded by mindinsomnia."Like" token, awarded by visitorsama."Love" token, awarded by forresthopkinsa."Love" token, awarded by PatrickWilson."Love" token, awarded by Shimoon."Love" token, awarded by andruxa696."Love" token, awarded by bnzs."Like" token, awarded by YAFU.

Event Timeline

Dalai Felinto (dfelinto) lowered the priority of this task from 90 to Normal.Aug 20 2019, 9:32 PM
Dalai Felinto (dfelinto) created this task.
Brecht Van Lommel (brecht) triaged this task as High priority.Jun 18 2020, 7:29 PM

I was pretty surprised to discover the flaws in displacement baking as it currently stands. I'm happy to see this task but I'm a bit astonished about its lack of information.
Since I can't find much that's up to date, I went exploring with my students today. I hope this helps as some sort of overview from an end user perspective.

Regular displacement baking

The fact that it exclusively works with Multiresolution Modifiers is pretty restrictive, so I would suggest efforts be made towards enabling displacement baking From Selected to Active.
This is a known issue - Brecht posted in T82454 that the current baking system simply doesn't support it.
Regardless though, Bake from Multires works pretty okay, aside from a few problems:

  • The resulting displacement map returns 0.5 for every pixel unless both Low Resolution Mesh is checked (in the Bake properties) and Level Viewport is set to 0 (in the Multires modifier). Seems to me that this equals instructing Blender twice to calculate displacement relative to the base mesh.
  • When baking successfully completes, the pixels don't contain the expected object space values. Blender seems to assume that the resulting displacement map is to be exported as a byte image, and therefore sets it midlevel to 0.5, while squeezing the entire range to 0-1, even when the fresh image datablock is created with 32-bit Float enabled.
    • Given the lack of settings in this regard, I assume this is hardcoded. Though online distribution of displacement maps as byte images is unfortunately common, this should never be considered a convention.
    • The convention, from which relative displacement maps divert, is a midlevel of 0 and a range between -โˆž and +โˆž. It would not be unlike Blender (for better or for worse) to assume that baking to a 32-bit float image triggers this.
    • That said, it's absolutely fine for the baking system to provide the option to bake a relative displacement map, requiring the end user to set a midlevel and a scale value. This should however not be the default, much less the only option.
Vector displacement baking

As far as I'm aware, this hasn't made it into Blender yet. I'm obviously not much of a developer or a mathematician, but given the data the Multires modifier stores, I'd say Blender has pretty much everything it needs? Do correct me if I'm wrong, obviously.
I remember briefly talking about this with @Julien Kaspar (JulienKaspar) after Spring. Any more information on its potential difficulty to implement?