Commit: aa07660201e28e764774069af36a1172cc5391ef
Author: Clément Foucault
Date:   Tue Mar 6 23:17:50 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBaa07660201e28e764774069af36a1172cc5391ef

Eevee: Fix garbage on the first frames when enabling volumetrics.

Was cause by newly added shader deferred compilation.

===================================================================

M       source/blender/draw/engines/eevee/eevee_volumes.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c 
b/source/blender/draw/engines/eevee/eevee_volumes.c
index 0a1b0f7a52b..2dbce1379ec 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -360,7 +360,7 @@ void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, 
EEVEE_Data *vedata)
        if ((effects->enabled_effects & EFFECT_VOLUMETRIC) != 0) {
                const DRWContextState *draw_ctx = DRW_context_state_get();
                Scene *scene = draw_ctx->scene;
-               DRWShadingGroup *grp;
+               DRWShadingGroup *grp = NULL;
 
                /* Quick breakdown of the Volumetric rendering:
                 *
@@ -404,7 +404,8 @@ void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, 
EEVEE_Data *vedata)
                                DRW_shgroup_uniform_block(grp, "common_block", 
sldata->common_ubo);
                        }
                }
-               else {
+
+               if (grp == NULL) {
                        /* If no world or volume material is present just clear 
the buffer with this drawcall */
                        grp = 
DRW_shgroup_empty_tri_batch_create(e_data.volumetric_clear_sh,
                                                                     
psl->volumetric_world_ps,

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to