diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-02-16 10:59:17 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-02-16 11:05:44 +0300 |
commit | 36814ddc94b56a66675b854bc0d7485828ddcd31 (patch) | |
tree | 32d4a28a562294a13d77a46e8c11157dca1ff592 /source/blender/draw/engines/workbench/workbench_private.h | |
parent | dd79a715c98147dd1603b867502d3d8a0c8ca777 (diff) |
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
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_private.h')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_private.h | 9 |
1 files changed, 7 insertions, 2 deletions
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. */ |