diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-04-20 18:45:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-04-20 18:45:07 +0300 |
commit | 3735986e875981e5525ec8cec379023abcc692bf (patch) | |
tree | 9b8fd80b056484dc055b8f7fee7380edd88c0b5f /source | |
parent | 3d994b26ba9be0c89565a90b31598869383a22ab (diff) |
Fix T87440 EEVEE: Specular Light Viewport Render Pass wrong behavior
This was caused by the closure refactor. The radiance being masked
for SSR, we need to not enable SSR when trying to render the specular
color pass.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D11028
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 042fa621117..f05aa562e6b 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1081,12 +1081,22 @@ void EEVEE_material_output_accumulate(EEVEE_ViewLayerData *sldata, EEVEE_Data *v } } if (pd->render_passes & EEVEE_RENDER_PASS_SPECULAR_COLOR) { + bool prev_ssr = sldata->common_data.ssr_toggle; + if (prev_ssr) { + /* We need to disable ssr here so output radiance is not directed to the ssr buffer. */ + sldata->common_data.ssr_toggle = false; + GPU_uniformbuf_update(sldata->common_ubo, &sldata->common_data); + } material_renderpass_accumulate(fbl, material_accum_ps, NULL, pd, txl->spec_color_accum, sldata->renderpass_ubo.spec_color); + if (prev_ssr) { + sldata->common_data.ssr_toggle = prev_ssr; + GPU_uniformbuf_update(sldata->common_ubo, &sldata->common_data); + } } if (pd->render_passes & EEVEE_RENDER_PASS_SPECULAR_LIGHT) { material_renderpass_accumulate(fbl, |