Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-01 01:00:46 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-01 03:21:29 +0300
commit7f86afec9d6799e22127c53d9d0805a87462fc08 (patch)
tree566aca7a18e47b45251b10fcb5b4393c0d3562a8 /intern/cycles/kernel/kernel_path_surface.h
parent03d10703783a0d233517aac558ac3f0a7d55d302 (diff)
Cycles: don't count volume boundaries as transparent bounces.
This is more important now that we will have tigther volume bounds that we hit multiple times. It also avoids some noise due to RR previously affecting these surfaces, which shouldn't have been the case and should eventually be fixed for transparent BSDFs as well. For non-volume scenes I found no performance impact on NVIDIA or AMD. For volume scenes the noise decrease and fixed artifacts are worth the little extra render time, when there is any.
Diffstat (limited to 'intern/cycles/kernel/kernel_path_surface.h')
-rw-r--r--intern/cycles/kernel/kernel_path_surface.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/kernel/kernel_path_surface.h b/intern/cycles/kernel/kernel_path_surface.h
index 7b566b01b04..bca346d5ee0 100644
--- a/intern/cycles/kernel/kernel_path_surface.h
+++ b/intern/cycles/kernel/kernel_path_surface.h
@@ -329,10 +329,12 @@ ccl_device bool kernel_path_surface_bounce(KernelGlobals *kg,
}
#ifdef __VOLUME__
else if(sd->flag & SD_HAS_ONLY_VOLUME) {
- /* no surface shader but have a volume shader? act transparent */
-
- /* update path state, count as transparent */
- path_state_next(kg, state, LABEL_TRANSPARENT);
+ /* For volume bounding meshes we pass through without counting transparent
+ * bounces, only sanity check in case self intersection gets us stuck. */
+ state->volume_bounds_bounce++;
+ if (state->volume_bounds_bounce > VOLUME_BOUNDS_MAX) {
+ return false;
+ }
if(state->bounce == 0)
ray->t -= sd->ray_length; /* clipping works through transparent */