Transparency swallows volume scatter bounce #53914

Closed
opened 2018-01-27 07:56:28 +01:00 by Stefan Werner · 23 comments
Member

When a transparent surface penetrates a scattering volume, scatter rays can get stopped at the transparent surface instead of traversing it, regardless of the number of transparent bounces set in the render options.

See the attached file. The 100% transparent plane effectively cuts off volume scattering in the cube. The expected result is that a 100% transparent plane should have no visible influence on volume scattering.

Verified in Blender 2.79, master as of commit 7b29e91711 on macOS 10.13 and Windows 10.

I have a potential fix for this coming.

missing_volume_bounce.blend

When a transparent surface penetrates a scattering volume, scatter rays can get stopped at the transparent surface instead of traversing it, regardless of the number of transparent bounces set in the render options. See the attached file. The 100% transparent plane effectively cuts off volume scattering in the cube. The expected result is that a 100% transparent plane should have no visible influence on volume scattering. Verified in Blender 2.79, master as of commit 7b29e917118ffdeb39de5c942dd652d40914dbc3 on macOS 10.13 and Windows 10. I have a potential fix for this coming. [missing_volume_bounce.blend](https://archive.blender.org/developer/F1996599/missing_volume_bounce.blend)
Author
Member

Added subscriber: @Stefan_Werner

Added subscriber: @Stefan_Werner

#54103 was marked as duplicate of this issue

#54103 was marked as duplicate of this issue

This issue was referenced by blender/cycles@177afacea6

This issue was referenced by blender/cycles@177afacea6d60df615ac511e56f286d8e854ff2c

This issue was referenced by 3c852ba074

This issue was referenced by 3c852ba0741f794a697f95073b04921e9ff94039
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by blender/cycles@62f3a631d4

This issue was referenced by blender/cycles@62f3a631d40cf4d4ddf2caed25977f40472a94db

This issue was referenced by 282b3d0fcd

This issue was referenced by 282b3d0fcd0ab32d6f8ae1694bc50599788eb256

Added subscriber: @brecht

Added subscriber: @brecht

This commit is affecting many regression tests, and investigating it more closely I don't think it's correct, so I'll revert it for now to keep the tests passing. After this change it's no longer possible to get just direct volume lighting, it will always do at least 1 indirect volume bounce as well.

The same problem exists for diffuse or glossy bounces, the problem really is with volume emission (and mesh emission) for which we don't do any direct light sampling. Direct light shadow rays will go through the transparent surfaces to reach the emission, but indirect light rays will not.

I'm not sure yet what the right solution is.

This commit is affecting many regression tests, and investigating it more closely I don't think it's correct, so I'll revert it for now to keep the tests passing. After this change it's no longer possible to get just direct volume lighting, it will always do at least 1 indirect volume bounce as well. The same problem exists for diffuse or glossy bounces, the problem really is with volume emission (and mesh emission) for which we don't do any direct light sampling. Direct light shadow rays will go through the transparent surfaces to reach the emission, but indirect light rays will not. I'm not sure yet what the right solution is.

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
Author
Member

I see what you mean.

Just to make sure we're on the same page: Intended behaviour is that when max_volume_bounce is set to 0, we trace one scatter event inside the volume from which we gather emission inside the volume, but not any direct or indirect light? So volume emission will illuminate volume scattering, but not other surfaces (since we don't have next event estimation for volume emission)? And once we get next event estimation for volumes emission, it should then also illuminate surface shaders too?

I see what you mean. Just to make sure we're on the same page: Intended behaviour is that when max_volume_bounce is set to 0, we trace one scatter event inside the volume from which we gather emission inside the volume, but not any direct or indirect light? So volume emission will illuminate volume scattering, but not other surfaces (since we don't have next event estimation for volume emission)? And once we get next event estimation for volumes emission, it should then also illuminate surface shaders too?

The intended behavior is that when max_volume_bounce is 0, we gather direct lighting and emission from surfaces and volumes. The latter is also considered to be "direct lighting", so that a mesh light behaves the same as any other light. Using next event estimation or not should not make any difference in the converged render result, but it is different in this case due to an inconsistency with the handling of transparent surfaces.

If you run the regression tests you'll see the difference, but here's an example where you can see how surfaces and volume handle indirect light differently after the fix:

Before Fix After Fix
Max surface and volume bounces 0 old_max_bounce_0.png new_max_bounce_0.png
Max surface and volume bounces 1 old_max_bounce_1.png new_max_bounce_1.png

max_bounce_volume_surface.blend

Currently I'm thinking the fix could be something like this:

  • Move the max bounces test into path_state_next(), setting a state->flag to indicate the path is to be terminated.
  • If that flag is set shader evaluation at the next bounce will remove all closures except for emission and transparency (or not add them in the first place: D2938).
  • The path can then continue for transparency but not other BSDF/BSSRDF types.

Maybe there's a simpler way to do it, I'm not sure.

The intended behavior is that when max_volume_bounce is 0, we gather direct lighting and emission from surfaces and volumes. The latter is also considered to be "direct lighting", so that a mesh light behaves the same as any other light. Using next event estimation or not should not make any difference in the converged render result, but it is different in this case due to an inconsistency with the handling of transparent surfaces. If you run the regression tests you'll see the difference, but here's an example where you can see how surfaces and volume handle indirect light differently after the fix: | |Before Fix|After Fix| | -- | -- | -- | |Max surface and volume bounces 0|![old_max_bounce_0.png](https://archive.blender.org/developer/F2037061/old_max_bounce_0.png)|![new_max_bounce_0.png](https://archive.blender.org/developer/F2037062/new_max_bounce_0.png)| |Max surface and volume bounces 1|![old_max_bounce_1.png](https://archive.blender.org/developer/F2037063/old_max_bounce_1.png)|![new_max_bounce_1.png](https://archive.blender.org/developer/F2037085/new_max_bounce_1.png)| [max_bounce_volume_surface.blend](https://archive.blender.org/developer/F2037086/max_bounce_volume_surface.blend) Currently I'm thinking the fix could be something like this: * Move the max bounces test into `path_state_next()`, setting a `state->flag` to indicate the path is to be terminated. * If that flag is set shader evaluation at the next bounce will remove all closures except for emission and transparency (or not add them in the first place: [D2938](https://archive.blender.org/developer/D2938)). * The path can then continue for transparency but not other BSDF/BSSRDF types. Maybe there's a simpler way to do it, I'm not sure.
Author
Member

That sounds like a good approach. I suspect that in general, transparent intersections can lead to incorrect path termination. Note how for example how an environment light with diffuse bounces = 0 will not provide direct illumination through transparency. Volume emission currently also provides direct light to surfaces inside the volume's bounds, but not to surfaces outside of the volume's bounds.

That sounds like a good approach. I suspect that in general, transparent intersections can lead to incorrect path termination. Note how for example how an environment light with diffuse bounces = 0 will not provide direct illumination through transparency. Volume emission currently also provides direct light to surfaces inside the volume's bounds, but not to surfaces outside of the volume's bounds.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

This shouldn't have been closed yet.

This shouldn't have been closed yet.

This issue was referenced by blender/cycles@23fa049ad2

This issue was referenced by blender/cycles@23fa049ad23931c813697b2368f6a2eacfd0301f

This issue was referenced by 2d81758aa6

This issue was referenced by 2d81758aa650256d6b6ed283e43b6c35808ed205

Added subscribers: @derekbarker, @ThomasDinges, @Sergey

Added subscribers: @derekbarker, @ThomasDinges, @Sergey

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @valera-8

Added subscriber: @valera-8

This bug is still present in 2.90.1, do I need to submit a new bug report or will this one be re-opened?

This bug is still present in 2.90.1, do I need to submit a new bug report or will this one be re-opened?

We don't reopen old bug reports, a new one should be submitted since it's likely a different cause.

We don't reopen old bug reports, a new one should be submitted since it's likely a different cause.
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
5 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#53914
No description provided.