Regression: Shadow always produces black image on baking #107777

Closed
opened 2023-05-09 11:23:24 +02:00 by KumoKairo · 8 comments

System Information
Operating system: Windows 11, 22H2 (Build 22621.1555)
Graphics card: RTX 3080 Mobile (laptop version)

Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-08 02:10, hash: rB04693f90748e
Worked: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-05 01:58, hash: rB9cb061f4f011

This broke with the removal of the Shadow Pass in 0731d78d00

Short description of error
Baking textures with Bake Type set to Shadow always produces Black Transparent texture

Exact steps for others to reproduce the error

  1. Open attached file (It only contains a default scene and an additional plane used for baking shadows).
  2. Observe that the ground plane has correct UV mapping.
  3. Observe that material of the ground plane has an Image Texture node selected with an appropriate texture called "Shadow".
  4. Observe that shadow from a cube is visible on a ground plane (rendered view or a full render of the scene).
  5. Select the ground plane.
  6. Go to Render Properties -> Bake.
  7. Select Bake Type: Shadow.
  8. Click Bake, wait for the process to complete.
  9. In the Image Editor / UV Editor window observe that the Shadow texture is Black and Transparent.

Expected result - Shadow texture contains a shadow from a cube
Actual result - Shadow texture contains zeros on all channels

  • Also tested on MacOS Ventura 13.0.1 on Apple Mac Mini M1
  • Also tested on latest nightly builds 3.5.1 and 3.6.0 alpha

All with the same result
Changing Render device from GPU Compute to CPU doesn't fix the problem

**System Information** Operating system: Windows 11, 22H2 (Build 22621.1555) Graphics card: RTX 3080 Mobile (laptop version) **Blender Version** Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-08 02:10, hash: `rB04693f90748e` Worked: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-05 01:58, hash: `rB9cb061f4f011` This broke with the removal of the Shadow Pass in 0731d78d0096939ad61b0c81cba888f5a1f98001 **Short description of error** Baking textures with Bake Type set to Shadow always produces Black Transparent texture **Exact steps for others to reproduce the error** 1. Open attached file (It only contains a default scene and an additional plane used for baking shadows). 2. Observe that the ground plane has correct UV mapping. 3. Observe that material of the ground plane has an Image Texture node selected with an appropriate texture called "Shadow". 4. Observe that shadow from a cube is visible on a ground plane (rendered view or a full render of the scene). 5. Select the ground plane. 6. Go to Render Properties -> Bake. 7. Select Bake Type: Shadow. 8. Click Bake, wait for the process to complete. 9. In the Image Editor / UV Editor window observe that the Shadow texture is Black and Transparent. Expected result - Shadow texture contains a shadow from a cube Actual result - Shadow texture contains zeros on all channels - Also tested on MacOS Ventura 13.0.1 on Apple Mac Mini M1 - Also tested on latest nightly builds 3.5.1 and 3.6.0 alpha All with the same result Changing Render device from GPU Compute to CPU doesn't fix the problem
KumoKairo added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-05-09 11:23:25 +02:00
Iliya Katushenock changed title from Bake Type: Shadow always produces black image to Regression: Shadow always produces black image on baking 2023-05-09 11:47:24 +02:00
Iliya Katushenock added
Priority
High
and removed
Priority
Normal
labels 2023-05-09 11:57:02 +02:00

At the time of the bug, there were many commits associated with cycles. Not sure if I can guess who the culprit is.

At the time of the bug, there were many commits associated with cycles. Not sure if I can guess who the culprit is.
Member

Will check.

Will check.
Member

This broke with the removal of the Shadow Pass in 0731d78d00

Compared to the pass [which has the alternative of the shadow catcher] I havent checked how/if this can be baked properly @sergey ?

@brecht : since this is non, funtional, it should also be removed from the bake_type EnumProperty ? If we do that (and happen to open files with this bake_type set), then just set it to "Combined" in do_version?

This broke with the removal of the Shadow Pass in 0731d78d0096939ad61b0c81cba888f5a1f98001 Compared to the pass [which has the alternative of the shadow catcher] I havent checked how/if this can be baked properly @sergey ? @brecht : since this is non, funtional, it should also be removed from the `bake_type` `EnumProperty` ? If we do that (and happen to open files with this `bake_type` set), then just set it to "Combined" in `do_version`?
Member

Similar to #106482 btw.

Similar to #106482 btw.
Author

#106482 mentions use "shadow catcher" passes, but they are not available when baking. I agree that this is a pretty specific case, but it was in Blender forever, and if there is no way to solve shadow-only baking using alternative ways in Blender, it would be a huge loss

#106482 mentions use "shadow catcher" passes, but they are not available when baking. I agree that this is a pretty specific case, but it was in Blender forever, and if there is no way to solve shadow-only baking using alternative ways in Blender, it would be a huge loss
Member

Still havent checked (sorry, looking into another issue atm.), but maybe there is a way to bake a shadow catcher with one of the other bake types to get the desired result?

Still havent checked (sorry, looking into another issue atm.), but maybe there is a way to bake a shadow catcher with one of the other bake types to get the desired result?
Author

Unfortunately, it doesn't seem possible - I have spent more than three days trying to find a workaround using other bake types, shader nodes and post-processing tricks. As far as I can tell right now - nothing can replace pure "Shadow" type - it will contain unnecessary information like lighting, shading, or AO. No amount of filters or post-processing can get close to this type in terms of quality and "separation" between actual shadows and other shading "parts". "Shadow" type is pretty unique in a sense that it really only captures the shadows and nothing else.

If there would be a way to simulate this baking using Shadow Catcher (because this bake type is pretty much just a shadow catcher), that would definitely solve it

I have temporarily solved the issue by downgrading to 3.4.1 and will probably take a look at it myself a bit later, because I cannot really imagine how Blender will continue the development without this insanely important feature

Unfortunately, it doesn't seem possible - I have spent more than three days trying to find a workaround using other bake types, shader nodes and post-processing tricks. As far as I can tell right now - nothing can replace pure "Shadow" type - it will contain unnecessary information like lighting, shading, or AO. No amount of filters or post-processing can get close to this type in terms of quality and "separation" between actual shadows and other shading "parts". "Shadow" type is pretty unique in a sense that it really only captures the shadows and nothing else. If there would be a way to simulate this baking using Shadow Catcher (because this bake type is pretty much just a shadow catcher), that would definitely solve it I have temporarily solved the issue by downgrading to 3.4.1 and will **probably** take a look at it myself a bit later, because I cannot really imagine how Blender will continue the development without this insanely important feature

I think the solution here is to add support for baking the shadow catcher pass.

I think the solution here is to add support for baking the shadow catcher pass.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-05-12 21:01:44 +02: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 project
No Assignees
4 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#107777
No description provided.