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:
authorClément Foucault <foucault.clem@gmail.com>2022-07-13 18:31:04 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-07-21 16:50:35 +0300
commite022753d7a675604e507b156b2dae658cd6d7a0c (patch)
tree6c9cc65bec18fc3502cd9067af50fbadbb41e97e /source/blender/draw/engines/eevee_next/eevee_view.cc
parent2bad3577c079a738030ec252e906122c24315e98 (diff)
EEVEE-Next: Add Temporal-AntiAliasing
The improvements over the old implementation are: - Improved history reprojection filter (catmull-rom) - Use proper velocity for history reprojection. - History clipping is now done in YCoCg color space using better algorithm. - Velocity is dilated to keep correct edge anti-aliasing on moving objects. As a result, the 3x3 blocks that made the image smoother in the previous implementation are no longer visible is replaced by correct antialiasing. This removes the velocity resolve pass in order to reduce the bandwidth usage. The velocities are just resolved as they are loadded in the film pass.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_view.cc')
-rw-r--r--source/blender/draw/engines/eevee_next/eevee_view.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_view.cc b/source/blender/draw/engines/eevee_next/eevee_view.cc
index f4dba47721d..1a222dc4ebd 100644
--- a/source/blender/draw/engines/eevee_next/eevee_view.cc
+++ b/source/blender/draw/engines/eevee_next/eevee_view.cc
@@ -80,7 +80,6 @@ void ShadingView::sync()
// dof_.sync(winmat_p, extent_);
// mb_.sync(extent_);
- velocity_.sync();
// rt_buffer_opaque_.sync(extent_);
// rt_buffer_refract_.sync(extent_);
// inst_.hiz_back.view_sync(extent_);
@@ -103,18 +102,20 @@ void ShadingView::render()
RenderBuffers &rbufs = inst_.render_buffers;
rbufs.acquire(extent_, owner);
- velocity_.acquire(extent_);
combined_fb_.ensure(GPU_ATTACHMENT_TEXTURE(rbufs.depth_tx),
GPU_ATTACHMENT_TEXTURE(rbufs.combined_tx));
prepass_fb_.ensure(GPU_ATTACHMENT_TEXTURE(rbufs.depth_tx),
- GPU_ATTACHMENT_TEXTURE(velocity_.view_vectors_get()));
+ GPU_ATTACHMENT_TEXTURE(rbufs.vector_tx));
update_view();
DRW_stats_group_start(name_);
DRW_view_set_active(render_view_);
- float4 clear_velocity(VELOCITY_INVALID);
+ /* If camera has any motion, compute motion vector in the film pass. Otherwise, we avoid float
+ * precision issue by setting the motion of all static geometry to 0. */
+ float4 clear_velocity = float4(inst_.velocity.camera_has_motion() ? VELOCITY_INVALID : 0.0f);
+
GPU_framebuffer_bind(prepass_fb_);
GPU_framebuffer_clear_color(prepass_fb_, clear_velocity);
/* Alpha stores transmittance. So start at 1. */
@@ -137,18 +138,14 @@ void ShadingView::render()
// inst_.lights.debug_draw(view_fb_);
// inst_.shadows.debug_draw(view_fb_);
- velocity_.resolve(rbufs.depth_tx);
-
// GPUTexture *final_radiance_tx = render_post(combined_tx_);
inst_.film.accumulate(sub_view_);
rbufs.release();
+ postfx_tx_.release();
DRW_stats_group_end();
-
- postfx_tx_.release();
- velocity_.release();
}
GPUTexture *ShadingView::render_post(GPUTexture *input_tx)