]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix: correct wall AO having weird sharp edges (macOS only?) (#38552)
authorPerry Fraser <perryprog@users.noreply.github.com>
Tue, 24 Jun 2025 20:39:18 +0000 (16:39 -0400)
committerGitHub <noreply@github.com>
Tue, 24 Jun 2025 20:39:18 +0000 (22:39 +0200)
Content.Client/Light/AmbientOcclusionOverlay.cs

index f6b4d0cdfc0d15cd52511f16f6c2babe8e9748b8..f771dbe9fc440f0f64f236d4d57372e092d72a00 100644 (file)
@@ -24,6 +24,7 @@ public sealed class AmbientOcclusionOverlay : Overlay
     public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowEntities;
 
     private IRenderTexture? _aoTarget;
+    private IRenderTexture? _aoBlurBuffer;
 
     // Couldn't figure out a way to avoid this so if you can then please do.
     private IRenderTexture? _aoStencilTarget;
@@ -70,6 +71,12 @@ public sealed class AmbientOcclusionOverlay : Overlay
             _aoTarget = _clyde.CreateRenderTarget(target.Size, new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "ambient-occlusion-target");
         }
 
+        if (_aoBlurBuffer?.Texture.Size != target.Size)
+        {
+            _aoBlurBuffer?.Dispose();
+            _aoBlurBuffer = _clyde.CreateRenderTarget(target.Size, new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "ambient-occlusion-blur-target");
+        }
+
         if (_aoStencilTarget?.Texture.Size != target.Size)
         {
             _aoStencilTarget?.Dispose();
@@ -95,7 +102,7 @@ public sealed class AmbientOcclusionOverlay : Overlay
                 }
             }, Color.Transparent);
 
-        _clyde.BlurRenderTarget(viewport, _aoTarget, _aoTarget, viewport.Eye!, 14f);
+        _clyde.BlurRenderTarget(viewport, _aoTarget, _aoBlurBuffer, viewport.Eye!, 14f);
 
         // Need to do stencilling after blur as it will nuke it.
         // Draw stencil for the grid so we don't draw in space.