diff options
Diffstat (limited to 'source/blender/draw/engines')
4 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index ddc5eae768e..5341661735f 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -212,6 +212,7 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) common_data->spec_toggle = true; common_data->ssr_toggle = true; + common_data->ssrefract_toggle = true; common_data->sss_toggle = true; /* Placeholder planar pool: used when rendering planar reflections (avoid dependency loop). */ @@ -1264,6 +1265,7 @@ void EEVEE_lightprobes_refresh_planar(EEVEE_ViewLayerData *sldata, EEVEE_Data *v common_data->prb_num_planar = 0; /* Turn off ssr to avoid black specular */ common_data->ssr_toggle = false; + common_data->ssrefract_toggle = false; common_data->sss_toggle = false; common_data->ray_type = EEVEE_RAY_GLOSSY; @@ -1281,6 +1283,7 @@ void EEVEE_lightprobes_refresh_planar(EEVEE_ViewLayerData *sldata, EEVEE_Data *v /* Restore */ common_data->prb_num_planar = pinfo->num_planar; common_data->ssr_toggle = true; + common_data->ssrefract_toggle = true; common_data->sss_toggle = true; /* Prefilter for SSR */ diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 152b8fa5d0a..93a4e43d3af 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -671,6 +671,7 @@ typedef struct EEVEE_CommonUniformBuffer { float ssr_firefly_fac; /* float */ float ssr_brdf_bias; /* float */ int ssr_toggle; /* bool */ + int ssrefract_toggle; /* bool */ /* SubSurface Scattering */ float sss_jitter_threshold; /* float */ int sss_toggle; /* bool */ @@ -690,8 +691,6 @@ typedef struct EEVEE_CommonUniformBuffer { int hiz_mip_offset; /* int */ int ray_type; /* int */ float ray_depth; /* float */ - - float pad_common_ubo; } EEVEE_CommonUniformBuffer; BLI_STATIC_ASSERT_ALIGN(EEVEE_CommonUniformBuffer, 16) diff --git a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl index da0778b8a10..c7ae2417904 100644 --- a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl @@ -23,6 +23,7 @@ layout(std140) uniform common_block float ssrFireflyFac; float ssrBrdfBias; bool ssrToggle; + bool ssrefractToggle; /* SubSurface Scattering */ float sssJitterThreshold; bool sssToggle; diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl index 814cb13de0a..53f1517505c 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl @@ -344,7 +344,7 @@ void CLOSURE_NAME(vec3 N /* Screen Space Refraction */ /* ---------------------------- */ # ifdef USE_REFRACTION - if (ssrToggle && roughness < ssrMaxRoughness + 0.2) { + if (ssrefractToggle && roughness < ssrMaxRoughness + 0.2) { /* Find approximated position of the 2nd refraction event. */ vec3 refr_vpos = (refractionDepth > 0.0) ? transform_point(ViewMatrix, refr_pos) : viewPosition; |