diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-10-13 19:48:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-10-13 20:58:14 +0300 |
commit | d39cd851c0ca67dff975b1c447089d319ef0816f (patch) | |
tree | fd5a25fed2625aa5fd05b02590545f07a10eb264 /source/blender/draw/engines/eevee/eevee_lightprobes.c | |
parent | 98a62a5c088b18d5dd7d60e733c618d9c3db3a46 (diff) |
Fix T89777 EEVEE: Contact Shadows causes wrong shading in Reflection Plane
The planar reflections being rendered at the same resolution as the HiZ max
buffer, do not need any uv correction during raytracing.
However, the GTAO horizon buffer being at output resolution do need the
uv factors in order to match the pixels visible on screen. To avoid many
complication, we increase the size of the GTAO texture up to the hiz buffer
size. This way, if planar reflections need GTAO the texture is big enough.
We change the viewport of the GTAO framebuffer for the main view in order
to not have to modify Uvs in many places.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 8598655477f..56227bc95ec 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -1203,6 +1203,8 @@ void EEVEE_lightprobes_refresh_planar(EEVEE_ViewLayerData *sldata, EEVEE_Data *v return; } + float hiz_uv_scale_prev[2] = {UNPACK2(common_data->hiz_uv_scale)}; + /* Temporary Remove all planar reflections (avoid lag effect). */ common_data->prb_num_planar = 0; /* Turn off ssr to avoid black specular */ @@ -1212,6 +1214,9 @@ void EEVEE_lightprobes_refresh_planar(EEVEE_ViewLayerData *sldata, EEVEE_Data *v common_data->ray_type = EEVEE_RAY_GLOSSY; common_data->ray_depth = 1.0f; + /* Planar reflections are rendered at the hiz resolution, so no need to scalling. */ + copy_v2_fl(common_data->hiz_uv_scale, 1.0f); + GPU_uniformbuf_update(sldata->common_ubo, &sldata->common_data); /* Rendering happens here! */ @@ -1227,6 +1232,7 @@ void EEVEE_lightprobes_refresh_planar(EEVEE_ViewLayerData *sldata, EEVEE_Data *v common_data->ssr_toggle = true; common_data->ssrefract_toggle = true; common_data->sss_toggle = true; + copy_v2_v2(common_data->hiz_uv_scale, hiz_uv_scale_prev); /* Prefilter for SSR */ if ((vedata->stl->effects->enabled_effects & EFFECT_SSR) != 0) { |