diff options
author | Jeroen Bakker <jbakker> | 2020-07-02 12:19:12 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-07-02 12:27:23 +0300 |
commit | ba2c039b05a84de1dccbeef71b8b2ac89a072869 (patch) | |
tree | ea652b6ebdc9d04d757042fed984bac9b7085bdc /source/blender/draw/engines | |
parent | 945d0269e32efa1e5fd4091ae0f6366031f5ed04 (diff) |
Fix T77686: EEVEE environment pass with film transparency
When the film is set to transparent the environment pass should still be
rendered solid. otherwise it renders black.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D8046
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 20 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_private.h | 4 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | 1 |
3 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 8537ad0e532..8c17ecd3905 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -325,27 +325,31 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, if (sldata->renderpass_ubo.combined == NULL) { sldata->renderpass_ubo.combined = DRW_uniformbuffer_create( sizeof(EEVEE_RenderPassData), - &(const EEVEE_RenderPassData){true, true, true, true, true, false}); + &(const EEVEE_RenderPassData){true, true, true, true, true, false, false}); sldata->renderpass_ubo.diff_color = DRW_uniformbuffer_create( sizeof(EEVEE_RenderPassData), - &(const EEVEE_RenderPassData){true, false, false, false, false, true}); + &(const EEVEE_RenderPassData){true, false, false, false, false, true, false}); sldata->renderpass_ubo.diff_light = DRW_uniformbuffer_create( sizeof(EEVEE_RenderPassData), - &(const EEVEE_RenderPassData){true, true, false, false, false, false}); + &(const EEVEE_RenderPassData){true, true, false, false, false, false, false}); sldata->renderpass_ubo.spec_color = DRW_uniformbuffer_create( sizeof(EEVEE_RenderPassData), - &(const EEVEE_RenderPassData){false, false, true, false, false, false}); + &(const EEVEE_RenderPassData){false, false, true, false, false, false, false}); sldata->renderpass_ubo.spec_light = DRW_uniformbuffer_create( sizeof(EEVEE_RenderPassData), - &(const EEVEE_RenderPassData){false, false, true, true, false, false}); + &(const EEVEE_RenderPassData){false, false, true, true, false, false, false}); sldata->renderpass_ubo.emit = DRW_uniformbuffer_create( sizeof(EEVEE_RenderPassData), - &(const EEVEE_RenderPassData){false, false, false, false, true, false}); + &(const EEVEE_RenderPassData){false, false, false, false, true, false, false}); + + sldata->renderpass_ubo.environment = DRW_uniformbuffer_create( + sizeof(EEVEE_RenderPassData), + &(const EEVEE_RenderPassData){true, true, true, true, true, false, true}); } /* Used combined pass by default. */ @@ -408,7 +412,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_shgroup_uniform_block(grp, "planar_block", sldata->planar_ubo); DRW_shgroup_uniform_block(grp, "light_block", sldata->light_ubo); DRW_shgroup_uniform_block(grp, "shadow_block", sldata->shadow_ubo); - DRW_shgroup_uniform_block(grp, "renderpass_block", sldata->renderpass_ubo.combined); + DRW_shgroup_uniform_block_ref(grp, "renderpass_block", &stl->g_data->renderpass_ubo); DRW_shgroup_call(grp, geom, NULL); } @@ -1073,7 +1077,7 @@ void EEVEE_material_output_accumulate(EEVEE_ViewLayerData *sldata, EEVEE_Data *v DRWPass *material_accum_ps = psl->material_accum_ps; if (pd->render_passes & EEVEE_RENDER_PASS_ENVIRONMENT) { material_renderpass_accumulate( - fbl, psl->background_accum_ps, pd, txl->env_accum, sldata->renderpass_ubo.combined); + fbl, psl->background_accum_ps, pd, txl->env_accum, sldata->renderpass_ubo.environment); } if (pd->render_passes & EEVEE_RENDER_PASS_EMIT) { material_renderpass_accumulate( diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 5005c5a8ba9..a67593773ab 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -417,7 +417,8 @@ typedef struct EEVEE_RenderPassData { int renderPassGlossyLight; int renderPassEmit; int renderPassSSSColor; - int _pad[2]; + int renderPassEnvironment; + int _pad[1]; } EEVEE_RenderPassData; /* ************ LIGHT UBO ************* */ @@ -835,6 +836,7 @@ typedef struct EEVEE_ViewLayerData { /* Material Render passes */ struct { struct GPUUniformBuffer *combined; + struct GPUUniformBuffer *environment; struct GPUUniformBuffer *diff_color; struct GPUUniformBuffer *diff_light; struct GPUUniformBuffer *spec_color; diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl index 393ecaf1fc5..a8b8566edec 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -94,6 +94,7 @@ layout(std140) uniform renderpass_block bool renderPassGlossyLight; bool renderPassEmit; bool renderPassSSSColor; + bool renderPassEnvironment; }; vec3 render_pass_diffuse_mask(vec3 diffuse_color, vec3 diffuse_light) |