Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_antialiasing.c8
-rw-r--r--source/blender/draw/engines/workbench/workbench_engine.c1
-rw-r--r--source/blender/draw/engines/workbench/workbench_private.h2
3 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
index 5c8730ac8f9..d2bd653a656 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
@@ -176,6 +176,14 @@ void workbench_antialiasing_engine_init(WORKBENCH_Data *vedata)
}
}
+ /* Reset the TAA when we have already draw a sample, but the sample count differs from previous
+ * time. This removes render artifacts when the viewport anti-aliasing in the user preferences is
+ * set to a lower value. */
+ if (wpd->taa_sample_len != wpd->taa_sample_len_previous) {
+ wpd->taa_sample = 0;
+ wpd->taa_sample_len_previous = wpd->taa_sample_len;
+ }
+
if (wpd->view_updated) {
wpd->taa_sample = 0;
wpd->view_updated = false;
diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c
index a88076d5fd7..f11a4aab668 100644
--- a/source/blender/draw/engines/workbench/workbench_engine.c
+++ b/source/blender/draw/engines/workbench/workbench_engine.c
@@ -55,6 +55,7 @@ void workbench_engine_init(void *ved)
if (!stl->wpd) {
stl->wpd = MEM_callocN(sizeof(*stl->wpd), __func__);
+ stl->wpd->taa_sample_len_previous = -1;
stl->wpd->view_updated = true;
}
diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h
index 2191e09bc24..967bdf9bae0 100644
--- a/source/blender/draw/engines/workbench/workbench_private.h
+++ b/source/blender/draw/engines/workbench/workbench_private.h
@@ -261,6 +261,8 @@ typedef struct WORKBENCH_PrivateData {
/* Temporal Antialiasing */
/** Total number of samples to after which TAA stops accumulating samples. */
int taa_sample_len;
+ /** Total number of samples of the previous TAA. When changed TAA will be reset. */
+ int taa_sample_len_previous;
/** Current TAA sample index in [0..taa_sample_len[ range. */
int taa_sample;
/** Inverse of taa_sample to divide the accumulation buffer. */