Fix: Editor - use non-jittered projection for post-TAA overlay grid

Add a managed `RenderView.GetOverlayProjection()` helper that returns the non-jittered projection once TAA has been resolved, and use it for editor overlay rendering paths.
This commit is contained in:
Andrei Gagua
2026-06-03 18:49:42 +03:00
parent 1a8827ba76
commit 7326cf65d8
3 changed files with 11 additions and 2 deletions
+2 -1
View File
@@ -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);
var projection = renderContext.View.GetOverlayProjection();
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;
+8
View File
@@ -33,6 +33,14 @@ namespace FlaxEngine
NonJitteredProjection = Projection;
}
/// <summary>
/// Gets projection matrix for overlay geometry rendered after temporal anti-aliasing has been resolved.
/// </summary>
public Matrix GetOverlayProjection()
{
return IsTaaResolved ? NonJitteredProjection : Projection;
}
/// <summary>
/// Initializes render view data.
/// </summary>
+1 -1
View File
@@ -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
projectionMatrix = renderContext.View.GetOverlayProjection(); // Fix TAA jittering when rendering UI in world after TAA resolve
Matrix.Multiply(ref viewMatrix, ref projectionMatrix, out Matrix viewProjectionMatrix);
// Pick a depth buffer