diff --git a/Source/Editor/Gizmo/GridGizmo.cs b/Source/Editor/Gizmo/GridGizmo.cs
index 71f20f8c2..a50636932 100644
--- a/Source/Editor/Gizmo/GridGizmo.cs
+++ b/Source/Editor/Gizmo/GridGizmo.cs
@@ -113,7 +113,8 @@ namespace FlaxEditor.Gizmo
if (cb != IntPtr.Zero)
{
var data = new Data();
- Matrix.Multiply(ref renderContext.View.View, ref renderContext.View.Projection, out var viewProjection);
+ renderContext.View.GetOverlayProjection(out var projection);
+ Matrix.Multiply(ref renderContext.View.View, ref projection, out var viewProjection);
Matrix.Transpose(ref viewProjection, out data.ViewProjectionMatrix);
data.ViewPos = renderContext.View.WorldPosition;
data.GridColor = options.Viewport.ViewportGridColor;
diff --git a/Source/Engine/Graphics/RenderView.cs b/Source/Engine/Graphics/RenderView.cs
index b71b2d19b..eee4ca677 100644
--- a/Source/Engine/Graphics/RenderView.cs
+++ b/Source/Engine/Graphics/RenderView.cs
@@ -33,6 +33,15 @@ namespace FlaxEngine
NonJitteredProjection = Projection;
}
+ ///
+ /// Gets projection matrix for overlay geometry rendered after temporal anti-aliasing has been resolved.
+ ///
+ /// Projection matrix valid for rendering before or after (matches current TAA jitter stage).
+ public void GetOverlayProjection(out Matrix projection)
+ {
+ projection = IsTaaResolved ? NonJitteredProjection : Projection;
+ }
+
///
/// Initializes render view data.
///
diff --git a/Source/Engine/UI/UICanvas.cs b/Source/Engine/UI/UICanvas.cs
index 225213dba..d5a18a58b 100644
--- a/Source/Engine/UI/UICanvas.cs
+++ b/Source/Engine/UI/UICanvas.cs
@@ -90,7 +90,7 @@ namespace FlaxEngine
Matrix.Multiply(ref worldMatrix, ref renderContext.View.View, out Matrix viewMatrix);
Matrix projectionMatrix = renderContext.View.Projection;
if (worldSpace && (Canvas.RenderLocation == PostProcessEffectLocation.Default || Canvas.RenderLocation == PostProcessEffectLocation.AfterAntiAliasingPass))
- projectionMatrix = renderContext.View.NonJitteredProjection; // Fix TAA jittering when rendering UI in world after TAA resolve
+ renderContext.View.GetOverlayProjection(out projectionMatrix); // Fix TAA jittering when rendering UI in world after TAA resolve
Matrix.Multiply(ref viewMatrix, ref projectionMatrix, out Matrix viewProjectionMatrix);
// Pick a depth buffer