From 36814ddc94b56a66675b854bc0d7485828ddcd31 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 16 Feb 2021 08:59:17 +0100 Subject: Workbench: Improve AntiAliasing sampling This improves stability and convergence speed of Workbench Temporal AntiAliasing. This adds a filtering kernel (blackmann-haris, same as EEVEE/Cycles) to the temporal antialiasing sampling. We also gather neighbor pixels since they might end up in the pixel footprint. We use a 1px radius for the filter window which is a bit less than the 1.5 default of cycles and EEVEE since it does blur quite a bit more than what we have now. Another improvement is that the filtering is now in log space which improves AntiAliasing around highlights. Theses improvement may not be very useful for every day case but it was an experiment to try to make TAA usable for GPencil. Test file used : {F9798807} |filtered+logspace|filtered|original| |{F9798847}|{F9798848}|{F9798849}| Reviewed By: jbakker Differential Revision: https://developer.blender.org/D10414 --- source/blender/draw/engines/workbench/workbench_private.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/draw/engines/workbench/workbench_private.h') diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h index 522aae7f542..6247436feea 100644 --- a/source/blender/draw/engines/workbench/workbench_private.h +++ b/source/blender/draw/engines/workbench/workbench_private.h @@ -164,6 +164,7 @@ typedef struct WORKBENCH_PassList { struct DRWPass *volume_ps; struct DRWPass *aa_accum_ps; + struct DRWPass *aa_accum_replace_ps; struct DRWPass *aa_edge_ps; struct DRWPass *aa_weight_ps; struct DRWPass *aa_resolve_ps; @@ -286,8 +287,12 @@ typedef struct WORKBENCH_PrivateData { 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. */ - float taa_sample_inv; + /** Weight accumulated. */ + float taa_weight_accum; + /** Samples weight for this iteration. */ + float taa_weights[9]; + /** Sum of taa_weights. */ + float taa_weights_sum; /** If the view has been updated and TAA needs to be reset. */ bool view_updated; /** True if the history buffer contains relevant data and false if it could contain garbage. */ -- cgit v1.2.3