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 <j.bakker@atmind.nl>2018-06-29 10:22:50 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-06-29 10:26:58 +0300
commit3169160a9741ff399059ce9900ac8cd503707b2f (patch)
tree88c1ebad37b81cc22d14f3e8102f8631cf7daf9e /source/blender/draw/engines/workbench/workbench_effect_aa.c
parent18d87e79e92e0cb4792ba3cb42c4ea84fcd29d90 (diff)
Workbench: TAA optimalization
First frame of the TAA is just a regular copy of the previous buffer. so we write directly to the final buffer and skip the taa shader. We do init the history buffer via blit so it will be initialized for the other iterations.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_effect_aa.c')
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_aa.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_effect_aa.c b/source/blender/draw/engines/workbench/workbench_effect_aa.c
index 4f1ca7f561b..95a81649522 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_aa.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_aa.c
@@ -61,11 +61,23 @@ void workbench_aa_draw_pass(WORKBENCH_Data *vedata, GPUTexture *tx)
DRW_draw_pass(psl->effect_aa_pass);
}
else if (TAA_ENABLED(wpd)) {
- GPU_framebuffer_bind(fbl->effect_fb);
- DRW_transform_to_display(tx);
-
- GPU_framebuffer_bind(dfbl->color_only_fb);
- workbench_taa_draw_pass(effect_info, psl->effect_aa_pass);
+ /*
+ * when drawing the first TAA frame, we transform directly to the
+ * color_only_fb as the TAA shader is just performing a direct copy.
+ * the workbench_taa_draw_screen_end will fill the history buffer
+ * for the other iterations.
+ */
+ if (effect_info->jitter_index == 1)
+ {
+ GPU_framebuffer_bind(dfbl->color_only_fb);
+ DRW_transform_to_display(tx);
+ }
+ else {
+ GPU_framebuffer_bind(fbl->effect_fb);
+ DRW_transform_to_display(tx);
+ GPU_framebuffer_bind(dfbl->color_only_fb);
+ DRW_draw_pass(psl->effect_aa_pass);
+ }
workbench_taa_draw_scene_end(vedata);
}
else {