From 736be7cf5899047167e6b377414f35b2043191e9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 8 Oct 2021 15:48:55 +0200 Subject: Fix T91997: Cycles glass + SSS not rendering correctly --- intern/cycles/kernel/integrator/integrator_subsurface.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/cycles/kernel/integrator/integrator_subsurface.h b/intern/cycles/kernel/integrator/integrator_subsurface.h index c309d20a046..9026de1c064 100644 --- a/intern/cycles/kernel/integrator/integrator_subsurface.h +++ b/intern/cycles/kernel/integrator/integrator_subsurface.h @@ -59,6 +59,9 @@ ccl_device int subsurface_bounce(INTEGRATOR_STATE_ARGS, ShaderData *sd, const Sh INTEGRATOR_STATE_WRITE(path, flag) = (path_flag & ~PATH_RAY_CAMERA) | PATH_RAY_SUBSURFACE; INTEGRATOR_STATE_WRITE(path, throughput) *= shader_bssrdf_sample_weight(sd, sc); + /* Advance random number offset for bounce. */ + INTEGRATOR_STATE_WRITE(path, rng_offset) += PRNG_BOUNCE_NUM; + if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { if (INTEGRATOR_STATE(path, bounce) == 0) { INTEGRATOR_STATE_WRITE(path, diffuse_glossy_ratio) = one_float3(); @@ -599,7 +602,7 @@ ccl_device_inline bool subsurface_scatter(INTEGRATOR_STATE_ARGS) integrator_state_write_isect(INTEGRATOR_STATE_PASS, &ss_isect.hits[0]); integrator_state_write_ray(INTEGRATOR_STATE_PASS, &ray); - /* Advanced random number offset for bounce. */ + /* Advance random number offset for bounce. */ INTEGRATOR_STATE_WRITE(path, rng_offset) += PRNG_BOUNCE_NUM; const int shader = intersection_get_shader(kg, &ss_isect.hits[0]); -- cgit v1.2.3