Fix T66811 Eevee: Flickering in weight paint mode
authorClément Foucault <foucault.clem@gmail.com>
Thu, 18 Jul 2019 10:55:11 +0000 (12:55 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 18 Jul 2019 10:55:26 +0000 (12:55 +0200)
This was caused by TAA offset being computed as the 2nd sample even if the
sampling was reset afterwards.

The fix is to update the matrices after any potential reset.

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

index 021afa64fee994d9a0a1d4964eb8a7f3205309a4..1b152afa3bff23678d0c98b96e5a9e0bc0861e3a 100644 (file)
@@ -161,6 +161,12 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
   effects->enabled_effects |= EEVEE_occlusion_init(sldata, vedata);
   effects->enabled_effects |= EEVEE_screen_raytrace_init(sldata, vedata);
 
+  if ((effects->enabled_effects & EFFECT_TAA) && effects->taa_current_sample > 1) {
+    /* Update matrices here because EEVEE_screen_raytrace_init can have reset the
+     * taa_current_sample. (See T66811) */
+    EEVEE_temporal_sampling_update_matrices(vedata);
+  }
+
   EEVEE_volumes_init(sldata, vedata);
   EEVEE_subsurface_init(sldata, vedata);
 
index 099147a82ddb0f77d18508c388cfe70997ccfa1c..96924efa8bcdb92d151a2f12bd975c51a560f680 100644 (file)
@@ -253,7 +253,6 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
         if (!DRW_state_is_image_render()) {
           effects->taa_current_sample += 1;
           repro_flag = 0;
-          EEVEE_temporal_sampling_update_matrices(vedata);
         }
       }
       else {