From f3b090af3a8dead9e51adcbc31120969aaf0b37a Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 26 Aug 2026 16:15:39 +0200 Subject: [PATCH] Fix `CameraSpace` canvas rendering with TAA jitter --- Source/Engine/UI/UICanvas.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/UI/UICanvas.cs b/Source/Engine/UI/UICanvas.cs index ff7f3eb8b..59f0f685b 100644 --- a/Source/Engine/UI/UICanvas.cs +++ b/Source/Engine/UI/UICanvas.cs @@ -81,7 +81,7 @@ namespace FlaxEngine bounds.Transformation.Translation -= renderContext.View.Origin; if (renderContext.View.Frustum.Contains(bounds.GetBoundingBox()) == ContainmentType.Disjoint) return; - var worldSpace = Canvas.RenderMode == CanvasRenderMode.WorldSpace || Canvas.RenderMode == CanvasRenderMode.WorldSpaceFaceCamera; + var drawInWorld = Canvas.RenderMode == CanvasRenderMode.CameraSpace || Canvas.RenderMode == CanvasRenderMode.WorldSpace || Canvas.RenderMode == CanvasRenderMode.WorldSpaceFaceCamera; Profiler.BeginEvent("UI Canvas"); Profiler.BeginEventGPU("UI Canvas"); @@ -90,7 +90,7 @@ namespace FlaxEngine Canvas.GetWorldMatrix(renderContext.View.Origin, out Matrix worldMatrix); 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)) + if (drawInWorld && (Canvas.RenderLocation == PostProcessEffectLocation.Default || Canvas.RenderLocation == PostProcessEffectLocation.AfterAntiAliasingPass)) 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); @@ -99,7 +99,7 @@ namespace FlaxEngine // Render GUI in 3D var features = Render2D.Features; - if (worldSpace) + if (drawInWorld) Render2D.Features &= ~Render2D.RenderingFeatures.VertexSnapping; Render2D.CallDrawing(Canvas.GUI, context, input, depthBuffer, ref viewProjectionMatrix); Render2D.Features = features;