diff options
author | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
commit | 7246c387435769a169ac24c91434c615df6434b4 (patch) | |
tree | 61842e3e0ce85e80720fdd7476d44d2e629f59fd /intern/cycles/kernel/integrator/path_state.h | |
parent | c5f55d17096d373791363e46004176e3f7f7ae52 (diff) | |
parent | 0b4bd3ddc016298e868169a541cf6c132b10c587 (diff) |
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'intern/cycles/kernel/integrator/path_state.h')
-rw-r--r-- | intern/cycles/kernel/integrator/path_state.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/intern/cycles/kernel/integrator/path_state.h b/intern/cycles/kernel/integrator/path_state.h index 54560905397..7197f0f2f3a 100644 --- a/intern/cycles/kernel/integrator/path_state.h +++ b/intern/cycles/kernel/integrator/path_state.h @@ -56,6 +56,18 @@ ccl_device_inline void path_state_init_integrator(KernelGlobals kg, INTEGRATOR_STATE_WRITE(state, path, continuation_probability) = 1.0f; INTEGRATOR_STATE_WRITE(state, path, throughput) = one_spectrum(); +#ifdef __PATH_GUIDING__ + INTEGRATOR_STATE_WRITE(state, path, unguided_throughput) = 1.0f; + INTEGRATOR_STATE_WRITE(state, guiding, path_segment) = nullptr; + INTEGRATOR_STATE_WRITE(state, guiding, use_surface_guiding) = false; + INTEGRATOR_STATE_WRITE(state, guiding, sample_surface_guiding_rand) = 0.5f; + INTEGRATOR_STATE_WRITE(state, guiding, surface_guiding_sampling_prob) = 0.0f; + INTEGRATOR_STATE_WRITE(state, guiding, bssrdf_sampling_prob) = 0.0f; + INTEGRATOR_STATE_WRITE(state, guiding, use_volume_guiding) = false; + INTEGRATOR_STATE_WRITE(state, guiding, sample_volume_guiding_rand) = 0.5f; + INTEGRATOR_STATE_WRITE(state, guiding, volume_guiding_sampling_prob) = 0.0f; +#endif + #ifdef __MNEE__ INTEGRATOR_STATE_WRITE(state, path, mnee) = 0; #endif @@ -249,7 +261,11 @@ ccl_device_inline float path_state_continuation_probability(KernelGlobals kg, /* Probabilistic termination: use sqrt() to roughly match typical view * transform and do path termination a bit later on average. */ - return min(sqrtf(reduce_max(fabs(INTEGRATOR_STATE(state, path, throughput)))), 1.0f); + Spectrum throughput = INTEGRATOR_STATE(state, path, throughput); +#if defined(__PATH_GUIDING__) && PATH_GUIDING_LEVEL >= 4 + throughput *= INTEGRATOR_STATE(state, path, unguided_throughput); +#endif + return min(sqrtf(reduce_max(fabs(throughput))), 1.0f); } ccl_device_inline bool path_state_ao_bounce(KernelGlobals kg, ConstIntegratorState state) |