diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-01 01:00:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-01 03:21:29 +0300 |
commit | 7f86afec9d6799e22127c53d9d0805a87462fc08 (patch) | |
tree | 566aca7a18e47b45251b10fcb5b4393c0d3562a8 /intern/cycles/kernel/kernel_path.h | |
parent | 03d10703783a0d233517aac558ac3f0a7d55d302 (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.h')
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index aef350b0658..b0f53aef2d5 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -445,8 +445,15 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, break; } - /* Setup and evaluate shader. */ + /* Setup shader data. */ shader_setup_from_ray(kg, sd, &isect, ray); + + /* Skip most work for volume bounding surface. */ +#ifdef __VOLUME__ + if(!(sd->flag & SD_HAS_ONLY_VOLUME)) { +#endif + + /* Evaluate shader. */ shader_eval_surface(kg, sd, state, state->flag); shader_prepare_closures(sd, state); @@ -523,6 +530,10 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, } #endif /* defined(__EMISSION__) */ +#ifdef __VOLUME__ + } +#endif + if(!kernel_path_surface_bounce(kg, sd, &throughput, state, &L->state, ray)) break; } @@ -605,8 +616,15 @@ ccl_device_forceinline void kernel_path_integrate( break; } - /* Setup and evaluate shader. */ + /* Setup shader data. */ shader_setup_from_ray(kg, &sd, &isect, ray); + + /* Skip most work for volume bounding surface. */ +#ifdef __VOLUME__ + if(!(sd.flag & SD_HAS_ONLY_VOLUME)) { +#endif + + /* Evaluate shader. */ shader_eval_surface(kg, &sd, state, state->flag); shader_prepare_closures(&sd, state); @@ -669,6 +687,10 @@ ccl_device_forceinline void kernel_path_integrate( /* direct lighting */ kernel_path_surface_connect_light(kg, &sd, emission_sd, throughput, state, L); +#ifdef __VOLUME__ + } +#endif + /* compute direct lighting and next bounce */ if(!kernel_path_surface_bounce(kg, &sd, &throughput, state, &L->state, ray)) break; |