Eevee: TAA: Remove 32 sample limit.
authorClément Foucault <foucault.clem@gmail.com>
Tue, 26 Sep 2017 19:39:25 +0000 (21:39 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 26 Sep 2017 19:39:25 +0000 (21:39 +0200)
source/blender/draw/engines/eevee/eevee_effects.c
source/blender/makesrna/intern/rna_scene.c

index 8318161ef69fc2a664be9c14bbfd32157d657797..741065a7df3ce724419bac907a4c607d4638259d 100644 (file)
@@ -758,13 +758,8 @@ void EEVEE_effects_init(EEVEE_SceneLayerData *sldata, EEVEE_Data *vedata)
 
                view_is_valid = view_is_valid && (stl->g_data->view_updated == false);
 
-               int taa_pref_samples = BKE_collection_engine_property_value_get_int(props, "taa_samples");
-               CLAMP(taa_pref_samples, 1, 32);
-               view_is_valid = view_is_valid && (effects->taa_total_sample == taa_pref_samples);
-
-               if (effects->taa_total_sample != taa_pref_samples) {
-                       effects->taa_total_sample = taa_pref_samples;
-               }
+               effects->taa_total_sample = BKE_collection_engine_property_value_get_int(props, "taa_samples");
+               MAX2(effects->taa_total_sample, 0);
 
                DRW_viewport_matrix_get(persmat, DRW_MAT_PERS);
                DRW_viewport_matrix_get(viewmat, DRW_MAT_VIEW);
@@ -772,8 +767,10 @@ void EEVEE_effects_init(EEVEE_SceneLayerData *sldata, EEVEE_Data *vedata)
                view_is_valid = view_is_valid && compare_m4m4(persmat, effects->prev_drw_persmat, 0.0001f);
                copy_m4_m4(effects->prev_drw_persmat, persmat);
 
-
-               if (view_is_valid && (effects->taa_current_sample < effects->taa_total_sample)) {
+               if (view_is_valid &&
+                   ((effects->taa_total_sample == 0) ||
+                    (effects->taa_current_sample < effects->taa_total_sample)))
+               {
                        effects->taa_current_sample += 1;
 
                        effects->taa_alpha = 1.0f - (1.0f / (float)(effects->taa_current_sample));
@@ -1484,7 +1481,9 @@ void EEVEE_draw_effects(EEVEE_Data *vedata)
                        DRW_framebuffer_blit(fbl->main, fbl->depth_double_buffer_fb, true);
                }
 
-               if (effects->taa_current_sample < effects->taa_total_sample) {
+               if ((effects->taa_total_sample == 0) ||
+                   (effects->taa_current_sample < effects->taa_total_sample))
+               {
                        DRW_viewport_request_redraw();
                }
        }
index 7b5f37d2187dd391cd66cc34b43e7afc3deab33b..84ff0d5a7ea1761e1a5ef515a82d068f73c32142 100644 (file)
@@ -6191,8 +6191,8 @@ static void rna_def_scene_layer_engine_settings_eevee(BlenderRNA *brna)
        prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
        RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_samples_get",
                                       "rna_LayerEngineSettings_Eevee_taa_samples_set", NULL);
-       RNA_def_property_ui_text(prop, "Samples", "Minimum number of temporal samples");
-       RNA_def_property_range(prop, 1, 32);
+       RNA_def_property_ui_text(prop, "Samples", "Minimum number of temporal samples, unlimited if 0");
+       RNA_def_property_range(prop, 0, INT_MAX);
        RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update");