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:
authorJeroen Bakker <jbakker>2020-05-14 13:44:26 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2020-05-14 13:44:42 +0300
commiteb23b39b7f7f4e0531b9acff3769ec3fa4e236ee (patch)
treee1c63ea2d8a788fa875120ec8cc58261bdaac514 /source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
parent80fffba132c58c0c4187b2905f7700f4597aa5c2 (diff)
Fix T76558: Decreasing Viewport Anti-Aliasing Samples Makes Scene Whiter
When setting the Viewport Anti-Aliasing samples in the user preferences to a lower sample count the anti-aliasing was not reset. This lead to incorrect result as the accum buffer would still hold the values of the larger sample count. This fix resets the TAA when the sample count is changed. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D7728
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_effect_antialiasing.c')
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_antialiasing.c8
1 files changed, 8 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;