Baking: Geometry behind transparent materials is ignored #119610

Open
opened 2024-03-18 03:52:58 +01:00 by SleepyEngi · 2 comments

System Information
Operating system: Windows 10
Graphics card: rtx 2060 super

Blender Version
Broken: 3.0, 4.0 , 4.1+
Worked: 3.0 beta 22ffd69a91

Short description of error
This is a very specific behavior that I believe was misinterpreted as an error & incorrectly reverted

#93082

This disables the ability to bake geometry behind other geometry with transparent materials. When you bake an object with transparent materials, any ray that hits a transparent object just ends there, instead of continuing, resulting in the inability to bake objects that have several layers of transparency, such as hair cards or any material with opacity/transparency.

If you do not want those objects to show, they should be turned off in render. Or use a holdout material instead.
Looking at the fix, it seems to replace transparency with holdout, so that's the problem, I think. User should manually use holdout instead, this just disables the ability to bake multiple layers of anything with transparency, which is a big problem

Exact steps for others to reproduce the error

  1. Open the blend file from the first bug report and try to bake a combined pass
  2. Once the texture is done baking, transparency/opacity materials will not show anything underneath

The mentioned bug report's behavior is actually what you would expect from baking transparent materials, being able to bake multiple layers of alpha. I think this fix should then be reverted.

**System Information** Operating system: Windows 10 Graphics card: rtx 2060 super **Blender Version** Broken: 3.0, 4.0 , 4.1+ Worked: [3.0 beta 22ffd69a91](https://projects.blender.org/blender/blender/commit/22ffd69a91c9) **Short description of error** This is a very specific behavior that I believe was misinterpreted as an error & incorrectly reverted https://projects.blender.org/blender/blender/issues/93082 This disables the ability to bake geometry behind other geometry with transparent materials. When you bake an object with transparent materials, any ray that hits a transparent object just ends there, instead of continuing, resulting in the inability to bake objects that have several layers of transparency, such as hair cards or any material with opacity/transparency. If you do not want those objects to show, they should be turned off in render. Or use a holdout material instead. Looking at the fix, it seems to replace transparency with holdout, so that's the problem, I think. User should manually use holdout instead, this just disables the ability to bake multiple layers of anything with transparency, which is a big problem **Exact steps for others to reproduce the error** 1. Open the blend file from the first bug report and try to bake a combined pass 2. Once the texture is done baking, transparency/opacity materials will not show anything underneath The mentioned bug report's behavior is actually what you would expect from baking transparent materials, being able to bake multiple layers of alpha. I think this fix should then be reverted.
SleepyEngi added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-03-18 03:52:59 +01:00
Member

This is a very specific behavior that I believe was misinterpreted as an error & incorrectly reverted
#93082

@brecht ^
Though baking is consistent in older versions as well. Not sure if this would be consider as a bug or request.

> This is a very specific behavior that I believe was misinterpreted as an error & incorrectly reverted #93082 @brecht ^ Though baking is consistent in older versions as well. Not sure if this would be consider as a bug or request.
Pratik Borhade added
Module
Render & Cycles
Status
Needs Info from Developers
and removed
Status
Needs Triage
labels 2024-03-18 04:39:59 +01:00
Author

The way I see it, it was an incorrect behavior that was fixed but immediately reverted afterwards.

While searching about this issue, I saw lots of people asking for this but saying this may be a limitation in the software, but now I'm seeing that it's possible, just disabled by this change.

I've looked at the fix f0be276514
It seems to replace the transparency with a holdout material from what I understand. So the baking now behaves like it's a holdout instead of transparency. I think this is what's incorrect; the user would expect it to behave like transparency, allowing bake to draw geometry under transparent materials. To replicate the current behavior, they would use a holdout material instead.

For people who may be having this issue as well and looked this up: Here's how you can enable alpha baking. You will have to re-compile blender from the source code so here's a guide for that:

https://developer.blender.org/docs/handbook/building_blender/windows/

Go to this file:

intern/cycles/scene/integrator.cpp

Go to around line 246, and delete the following lines:

if (scene->bake_manager->get_baking()) {
/* Baking does not need to trace through transparency, we only want to bake
* the object itself. */
kintegrator->filter_closures |= FILTER_CLOSURE_TRANSPARENT;
}

Save, commit the change, and re-compile blender.

Results in the bake no longer ignoring alpha, and allowing you to properly bake multiple layers of alpha cards. See image for the now properly working behavior.

The way I see it, it was an incorrect behavior that was fixed but immediately reverted afterwards. While searching about this issue, I saw lots of people asking for this but saying this may be a limitation in the software, but now I'm seeing that it's possible, just disabled by this change. I've looked at the fix https://projects.blender.org/blender/blender/commit/f0be276514f2b7cae27c744ac80f999fbc69f12f It seems to replace the transparency with a holdout material from what I understand. So the baking now behaves like it's a holdout instead of transparency. I think this is what's incorrect; the user would expect it to behave like transparency, allowing bake to draw geometry under transparent materials. To replicate the current behavior, they would use a holdout material instead. For people who may be having this issue as well and looked this up: Here's how you can enable alpha baking. You will have to re-compile blender from the source code so here's a guide for that: https://developer.blender.org/docs/handbook/building_blender/windows/ Go to this file: `intern/cycles/scene/integrator.cpp` Go to around line 246, and delete the following lines: if (scene->bake_manager->get_baking()) { /* Baking does not need to trace through transparency, we only want to bake * the object itself. */ kintegrator->filter_closures |= FILTER_CLOSURE_TRANSPARENT; } Save, commit the change, and re-compile blender. Results in the bake no longer ignoring alpha, and allowing you to properly bake multiple layers of alpha cards. See image for the now properly working behavior.
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
2 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#119610
No description provided.