1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Jitter shadow map dithering pattern across frames when TAA is enabled

This improves shadow quality by reducing the visibility of the noisy
pattern caused by dithering.

This jittering also applies when FSR2 is enabled, as it provides its own
form of temporal antialiasing.

Co-authored-by: Clay John <claynjohn@gmail.com>
This commit is contained in:
Hugo Locurcio
2023-05-26 18:32:01 +02:00
committed by clayjohn
parent 155fcd00b0
commit 0eb06da057
10 changed files with 54 additions and 47 deletions

View File

@@ -112,6 +112,7 @@ void RenderSceneDataRD::update_ubo(RID p_uniform_buffer, RS::ViewportDebugDraw p
ubo.taa_jitter[0] = taa_jitter.x;
ubo.taa_jitter[1] = taa_jitter.y;
ubo.taa_frame_count = taa_frame_count;
ubo.z_far = z_far;
ubo.z_near = z_near;

View File

@@ -48,6 +48,7 @@ public:
Transform3D cam_transform;
Projection cam_projection;
Vector2 taa_jitter;
float taa_frame_count = 0.0f;
uint32_t camera_visible_layers;
bool cam_orthogonal = false;
bool flip_y = false;
@@ -148,8 +149,8 @@ private:
float fog_height_density;
float fog_depth_curve;
float pad;
float fog_depth_begin;
float taa_frame_count; // Used to add break up samples over multiple frames. Value is an integer from 0 to taa_phase_count -1.
float fog_light_color[3];
float fog_depth_end;