Cycles - Overlapping emissive volumes generat unexpected bright hotspots around the intersection. #46108

Closed
opened 2015-09-14 15:00:02 +02:00 by Mark Allen · 19 comments

System Information
tested on two systems with identical results:
Windows 7, Intel Xeon quadcore & GTX 770
Windows 10, Intel Ivy bridge Quadcore & GTX 980

Blender Version
Tested on 2.75a, unknown before that.

Short description of error
Overlapping emissive volumes cause unexpected bright spots in the image, This is exacerbated by large steps sizes.

It can be compensated for by either using a clamp direct value or very small step size, however both of these can compromise image quality/render time significantly - this feels like an artifact we shouldn't have to work around? Understood if low priority though.

Exact steps for others to reproduce the error
Using attached .blend: Emissive volume overlap artifacts.blend just render default camera (CPU or GPU generate the same problem). Artifacts become visible after the first few dozen samples. Looks like:
Emissive volme overlap artifact.jpg
(may need to enlarge to see)

The setup is simple, default scene with the cube and lights removed, set to cycles render. Two spheres with a constant volume emission (at this case 0.1 strength), and a camera positioned so that the spheres occlude each other. Around the intersection patch we get a bright white circle.

Note that in this example I've increased volume sampling step size to 1, which is quite large but serves to demonstrate the point. In other projects I'm working on I've seen issue with steps as low as 0.05 even for large scenes (over ~100m distances, which is an incredibly long render!). I've also occasionally seen dark spots around emissive-volume intersection points, but have been unable to nail down accurate repro steps, will update if I do).

**System Information** tested on two systems with identical results: Windows 7, Intel Xeon quadcore & GTX 770 Windows 10, Intel Ivy bridge Quadcore & GTX 980 **Blender Version** Tested on 2.75a, unknown before that. **Short description of error** Overlapping emissive volumes cause unexpected bright spots in the image, This is exacerbated by large steps sizes. It can be compensated for by either using a clamp direct value or very small step size, however both of these can compromise image quality/render time significantly - this feels like an artifact we shouldn't have to work around? Understood if low priority though. **Exact steps for others to reproduce the error** Using attached .blend: [Emissive volume overlap artifacts.blend](https://archive.blender.org/developer/F233249/Emissive_volume_overlap_artifacts.blend) just render default camera (CPU or GPU generate the same problem). Artifacts become visible after the first few dozen samples. Looks like: ![Emissive volme overlap artifact.jpg](https://archive.blender.org/developer/F233250/Emissive_volme_overlap_artifact.jpg) (may need to enlarge to see) The setup is simple, default scene with the cube and lights removed, set to cycles render. Two spheres with a constant volume emission (at this case 0.1 strength), and a camera positioned so that the spheres occlude each other. Around the intersection patch we get a bright white circle. Note that in this example I've increased volume sampling step size to 1, which is quite large but serves to demonstrate the point. In other projects I'm working on I've seen issue with steps as low as 0.05 even for large scenes (over ~100m distances, which is an incredibly long render!). I've also occasionally seen dark spots around emissive-volume intersection points, but have been unable to nail down accurate repro steps, will update if I do).
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @PrimeNine

Added subscriber: @PrimeNine
Thomas Dinges self-assigned this 2015-09-15 21:15:57 +02:00

Does not happen with Branched Path, there it's fine. I am wondering why the Step Size affects this, it should not as this is a homogeneous volume.

Does not happen with Branched Path, there it's fine. I am wondering why the Step Size affects this, it should not as this is a homogeneous volume.
Author

Have just done a quick retest on the uploaded file, not sure if the extra info will help - on the intel Xeon/GTX 770 machine from before. I'm looking in the viewport rather than final render, but I'm not aware of differences. There does appear to be a difference between CPU+Branched Path and all other mixes of CPU/GPU & Branched/Normal:

GPU:
I do still see the same artifacts in Branched Path here. Using 4 samples (with x1 in all specific categories) and a step size of 1 I can see a dozen bright spots around the circle, more do seem to appear with more samples. Using a step of 0.01 (rather extreme) and watching the render one sample at a time the artifacts do show up in the first few samples (in the same pixels as before), but are much dimmer and get cleaned up by the averaging across samples very quickly.

This looks to be consistent with what I'm seeing in normal path tracing with the same sample/step count.

CPU:
If I switch to CPU rendering, path tracing behaves exactly the same and shows up these artifacts. Branched Path as you say looks flawless, at any step size I've tried (0.01, 0.1, 1 are all fine). Decidedly weird.

Idle musing: I did wonder (as a programmer but blender newb) if it's running into a numerical inaccuracy, missing the geometry at the intersection and assuming some "maximum" brightness over the volume step when this issue occurs, so a longer step contributes more overall light to the pixel than a short step.

Have just done a quick retest on the uploaded file, not sure if the extra info will help - on the intel Xeon/GTX 770 machine from before. I'm looking in the viewport rather than final render, but I'm not aware of differences. There does appear to be a difference between CPU+Branched Path and all other mixes of CPU/GPU & Branched/Normal: **GPU:** I do still see the same artifacts in Branched Path here. Using 4 samples (with x1 in all specific categories) and a step size of 1 I can see a dozen bright spots around the circle, more do seem to appear with more samples. Using a step of 0.01 (rather extreme) and watching the render one sample at a time the artifacts do show up in the first few samples (in the same pixels as before), but are much dimmer and get cleaned up by the averaging across samples very quickly. This looks to be consistent with what I'm seeing in normal path tracing with the same sample/step count. **CPU:** If I switch to CPU rendering, path tracing behaves exactly the same and shows up these artifacts. Branched Path as you say looks flawless, at any step size I've tried (0.01, 0.1, 1 are all fine). Decidedly weird. Idle musing: I did wonder (as a programmer but blender newb) if it's running into a numerical inaccuracy, missing the geometry at the intersection and assuming some "maximum" brightness over the volume step when this issue occurs, so a longer step contributes more overall light to the pixel than a short step.

Added subscriber: @brecht

Added subscriber: @brecht

It's most likely a ray intersection precision issue, where we miss an intersection and as a result assume the volume extends to infinity. This means it will hit the Max Steps, and with a larger step size that distance will be larger, leading to more emission.

The precision issue would be fixed ideally, but perhaps it's also a good idea to discard volumes segments with no finite exit point.

It's most likely a ray intersection precision issue, where we miss an intersection and as a result assume the volume extends to infinity. This means it will hit the Max Steps, and with a larger step size that distance will be larger, leading to more emission. The precision issue would be fixed ideally, but perhaps it's also a good idea to discard volumes segments with no finite exit point.

Added subscriber: @Sergey

Added subscriber: @Sergey

This actually happens with both branched and regular path tracers here. We talked with @ThomasDinges about roots of the issue in the IRC, but worth dumping some thoughts here.

Basically, what's most likely is happening is wrong volume stack when ray hits close enough to the intersection. This could happen due to two reasons:

  1. Ray leaves first volume and ray_offset() pushes ray inside second volume, which leads to a missing volume enter event.
  2. Ray enters first volume, keeps traversing and hits exact (in machine precision terms) intersection of two volumes. It's undefined which volume will be picked up here, could be any of them. This will either lead to a missing volume enter event (similar to 1) or will lead to missing volume exit event (causing bright spots).

Surely discarding volumes which are extended to infinity will solve bright spots from appearing, but it's just a partial problem caused by precision issues. We still wouldn't be able to deal with missing volume enter event.

Not sure we'll technically consider this a bug tho, precision issues happens here and there..

This actually happens with both branched and regular path tracers here. We talked with @ThomasDinges about roots of the issue in the IRC, but worth dumping some thoughts here. Basically, what's most likely is happening is wrong volume stack when ray hits close enough to the intersection. This could happen due to two reasons: 1. Ray leaves first volume and `ray_offset()` pushes ray inside second volume, which leads to a missing volume enter event. 2. Ray enters first volume, keeps traversing and hits exact (in machine precision terms) intersection of two volumes. It's undefined which volume will be picked up here, could be any of them. This will either lead to a missing volume enter event (similar to 1) or will lead to missing volume exit event (causing bright spots). Surely discarding volumes which are extended to infinity will solve bright spots from appearing, but it's just a partial problem caused by precision issues. We still wouldn't be able to deal with missing volume enter event. Not sure we'll technically consider this a bug tho, precision issues happens here and there..

This issue could also be fixed by recording all transparent intersections along a ray instead of just the first. We've discussed that as an optimization before, but it would also help with this precision issue.

This issue could also be fixed by recording all transparent intersections along a ray instead of just the first. We've discussed that as an optimization before, but it would also help with this precision issue.

Seems some help here is needed. So here's a quick patch which implements the idea of ignoring volumes with no exit point (one of the possible ways to go with that at least):

P316: Snippet for #46108

diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 650e3b0..657fb5d 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -675,6 +675,14 @@ ccl_device_inline float4 kernel_path_integrate(KernelGlobals *kg,
 #endif
 
 #ifdef __VOLUME__
+		if(!hit && state.volume_stack- [x].shader != SHADER_NONE) {
+			if(kernel_data.background.volume_shader != SHADER_NONE) {
+				state.volume_stack- [x].shader = SHADER_NONE;
+			}
+			else {
+				state.volume_stack- [x].shader = SHADER_NONE;
+			}
+		}
 		/* volume attenuation, emission, scatter */
 		if(state.volume_stack- [x].shader != SHADER_NONE) {
 			Ray volume_ray = ray;

But that opens other types of questions, like whether volume was never exit since we missed some event or because we've run out of camera clipping distance and actual exit will happen later and currently it's all fine.

As for recording all transparent intersections: we talked it about it in context of camera rays. While it's possible to get all transparent intersections for camera ray in regular integrator, there'll be some open issues still:

  • Implementing intersect_all for GPU will mean bumping memory usage quite a bit again, alternatively GPU will have the artifact unsolved
  • It wouldn't work for secondary rays

So perhaps it should be both: recording all transparent intersections for camera rays and then still have volume stack "validation", so secondary rays and GPU are still free from really visible artifacts.

Seems some help here is needed. So here's a quick patch which implements the idea of ignoring volumes with no exit point (one of the possible ways to go with that at least): [P316: Snippet for #46108](https://archive.blender.org/developer/P316.txt) ``` diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 650e3b0..657fb5d 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -675,6 +675,14 @@ ccl_device_inline float4 kernel_path_integrate(KernelGlobals *kg, #endif #ifdef __VOLUME__ + if(!hit && state.volume_stack- [x].shader != SHADER_NONE) { + if(kernel_data.background.volume_shader != SHADER_NONE) { + state.volume_stack- [x].shader = SHADER_NONE; + } + else { + state.volume_stack- [x].shader = SHADER_NONE; + } + } /* volume attenuation, emission, scatter */ if(state.volume_stack- [x].shader != SHADER_NONE) { Ray volume_ray = ray; ``` But that opens other types of questions, like whether volume was never exit since we missed some event or because we've run out of camera clipping distance and actual exit will happen later and currently it's all fine. As for recording all transparent intersections: we talked it about it in context of camera rays. While it's possible to get all transparent intersections for camera ray in regular integrator, there'll be some open issues still: - Implementing intersect_all for GPU will mean bumping memory usage quite a bit again, alternatively GPU will have the artifact unsolved - It wouldn't work for secondary rays So perhaps it should be both: recording all transparent intersections for camera rays and then still have volume stack "validation", so secondary rays and GPU are still free from really visible artifacts.

@ThomasDinges, are you actually looking into the report still?

@ThomasDinges, are you actually looking into the report still?

Haven't looked into this since last years EGSR. Still think it's worth to implement "intersect all transparent" for camera rays.

Haven't looked into this since last years EGSR. Still think it's worth to implement "intersect all transparent" for camera rays.

That wouldn't solve the root of the problem -- you'll still have fireflies when secondary ray hits those points. It is still required some trickery to avoid infinite volumes.

If you want i can steal this report and continue with those tricks i've mentioned above.

That wouldn't solve the root of the problem -- you'll still have fireflies when secondary ray hits those points. It is still required some trickery to avoid infinite volumes. If you want i can steal this report and continue with those tricks i've mentioned above.
Thomas Dinges removed their assignment 2016-06-08 15:48:32 +02:00
Sergey Sharybin was assigned by Thomas Dinges 2016-06-08 15:48:32 +02:00

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

Feel free :)

Feel free :)

This issue was referenced by blender/cycles@5df06c1499

This issue was referenced by blender/cycles@5df06c1499940a0e37b3980fdf95e0239b2542bd

This issue was referenced by dd58390d71

This issue was referenced by dd58390d71d7bee96bddded9106099086b078f5d

After looking a lot in the behavior of volume with different camera setups (especially, when clipping distance is inside the volume) came to conclusion current render results aren't really correct anyway (at least from own tests). So perhaps introducing some behavior difference is not that bad.

Finished the proposed change in D2212, let's move discussion there.

After looking a lot in the behavior of volume with different camera setups (especially, when clipping distance is inside the volume) came to conclusion current render results aren't really correct anyway (at least from own tests). So perhaps introducing some behavior difference is not that bad. Finished the proposed change in [D2212](https://archive.blender.org/developer/D2212), let's move discussion there.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#46108
No description provided.