Displacement baking with Cycles #68922

Open
opened 2019-08-20 21:32:34 +02:00 by Dalai Felinto · 16 comments
No description provided.
Author
Owner

Added subscriber: @dfelinto

Added subscriber: @dfelinto

#54696 was marked as duplicate of this issue

#54696 was marked as duplicate of this issue

Added subscriber: @pawel.palenica

Added subscriber: @pawel.palenica

Added subscriber: @BeckersC

Added subscriber: @BeckersC
Added subscribers: @brecht, @marcofugaro, @michaelknubben, @clepsydrae, @DuarteRamos

Added subscribers: @JulienKaspar, @frameshift

Added subscribers: @JulienKaspar, @frameshift

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 #82454 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. disp_01_settings.png

  • 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 @JulienKaspar after Spring. Any more information on its potential difficulty to implement?

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 #82454 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. ![disp_01_settings.png](https://archive.blender.org/developer/F9860483/disp_01_settings.png) - 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 @JulienKaspar after Spring. Any more information on its potential difficulty to implement?

Added subscriber: @FrancoisRimasson

Added subscriber: @FrancoisRimasson

Added subscribers: @JosephEagar, @Francis_J

Added subscribers: @JosephEagar, @Francis_J

Vector displacement baking would be useful if one were to add Vector Brush into sculp mode eventually. That would permit to bake VDM sculpted from a plane and apply this to a sculpt.

I know @JosephEagar was interested in implementing that eventually. But I would not talk for himself.

Vector displacement baking would be useful if one were to add Vector Brush into sculp mode eventually. That would permit to bake VDM sculpted from a plane and apply this to a sculpt. I know @JosephEagar was interested in implementing that eventually. But I would not talk for himself.

Added subscriber: @uelix

Added subscriber: @uelix

I don't know if it is worth mentioning, you could be looking for a different implementation, but @nutelz did these nodes to bake vector displacement maps in cycles a couple of years ago
https://www.youtube.com/watch?v=Dgrz7_Xl5Eo
https://drive.google.com/file/d/0B1mc80hFkBqcZHAxNUwtNENOTkU/view?resourcekey=0-0eEU1N7BLqFYYWlaGtK9eA
I think it is also included in this addon https://github.com/Secrop/ShaderNodesExtra2.80

I don't know if it is worth mentioning, you could be looking for a different implementation, but @nutelz did these nodes to bake vector displacement maps in cycles a couple of years ago https://www.youtube.com/watch?v=Dgrz7_Xl5Eo https://drive.google.com/file/d/0B1mc80hFkBqcZHAxNUwtNENOTkU/view?resourcekey=0-0eEU1N7BLqFYYWlaGtK9eA I think it is also included in this addon https://github.com/Secrop/ShaderNodesExtra2.80

Added subscriber: @nutelz

Added subscriber: @nutelz

Added subscriber: @Bender

Added subscriber: @Bender

I am creating high res textures with scanned date and baking displacement is absolute must for this. I was baking it in 2.79 when I was learning on low poly counts, but now my scans easily exceed 100M polygons which is impossible to import in old blender, it just hangs for hours and hours...now when new OBJ importer and exporters are here, I tried and now I can import huge files in 3.2 version and would be very nice if I could use blender for baking displacement as well...

I am creating high res textures with scanned date and baking displacement is absolute must for this. I was baking it in 2.79 when I was learning on low poly counts, but now my scans easily exceed 100M polygons which is impossible to import in old blender, it just hangs for hours and hours...now when new OBJ importer and exporters are here, I tried and now I can import huge files in 3.2 version and would be very nice if I could use blender for baking displacement as well...

Added subscriber: @cj-does-stuff

Added subscriber: @cj-does-stuff
Brecht Van Lommel added this to the Render & Cycles project 2023-02-07 19:08:06 +01:00
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 13:59:50 +01:00
Brecht Van Lommel added
Priority
Normal
and removed
Priority
High
labels 2023-02-15 10:24:54 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
11 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#68922
No description provided.