Fix T65761 Eevee: SSRefraction not working on first sample

There is no reason to disable the refraction on the first sample like SSR
does.

This was caussing issues when rendering.
This commit is contained in:
Clément Foucault 2019-07-09 14:32:02 +02:00
parent 7e34846176
commit 986ff461fb
Notes: blender-bot 2023-02-14 05:22:18 +01:00
Referenced by issue #65761, Eevee render inconsistency between 3D View, Viewport render, and F12 Render
4 changed files with 6 additions and 3 deletions

View File

@ -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 */

View File

@ -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)

View File

@ -23,6 +23,7 @@ layout(std140) uniform common_block
float ssrFireflyFac;
float ssrBrdfBias;
bool ssrToggle;
bool ssrefractToggle;
/* SubSurface Scattering */
float sssJitterThreshold;
bool sssToggle;

View File

@ -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;