Commit: 956a7bc3eaac6bf835b20e28cfdc150704f28227
Author: Clément Foucault
Date:   Sat Feb 3 03:00:39 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB956a7bc3eaac6bf835b20e28cfdc150704f28227

Eevee: Render: Force normal buffer creation if needed.

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

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

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

diff --git a/source/blender/draw/engines/eevee/eevee_effects.c 
b/source/blender/draw/engines/eevee/eevee_effects.c
index c1ac085230e..be39e06bac9 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -105,9 +105,10 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata, 
EEVEE_Data *vedata, Object
        EEVEE_FramebufferList *fbl = vedata->fbl;
        EEVEE_TextureList *txl = vedata->txl;
        EEVEE_EffectsInfo *effects;
+       const DRWContextState *draw_ctx = DRW_context_state_get();
+       ViewLayer *view_layer = draw_ctx->view_layer;
 
        const float *viewport_size = DRW_viewport_size_get();
-
        /* Shaders */
        if (!e_data.downsample_sh) {
                eevee_create_shader_downsample();
@@ -129,6 +130,13 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata, 
EEVEE_Data *vedata, Object
        effects->enabled_effects |= EEVEE_screen_raytrace_init(sldata, vedata);
        effects->enabled_effects |= EEVEE_volumes_init(sldata, vedata);
 
+       /* Force normal buffer creation. */
+       if (DRW_state_is_image_render() &&
+               (view_layer->passflag & SCE_PASS_NORMAL) != 0)
+       {
+               effects->enabled_effects |= EFFECT_NORMAL_BUFFER;
+       }
+
        /**
         * Ping Pong buffer
         */

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

Reply via email to