From: Perry Fraser Date: Tue, 24 Jun 2025 20:39:18 +0000 (-0400) Subject: fix: correct wall AO having weird sharp edges (macOS only?) (#38552) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9529cdfa2e48834153e31803c63ad179c347dc38;p=space-station-14.git fix: correct wall AO having weird sharp edges (macOS only?) (#38552) --- diff --git a/Content.Client/Light/AmbientOcclusionOverlay.cs b/Content.Client/Light/AmbientOcclusionOverlay.cs index f6b4d0cdfc..f771dbe9fc 100644 --- a/Content.Client/Light/AmbientOcclusionOverlay.cs +++ b/Content.Client/Light/AmbientOcclusionOverlay.cs @@ -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.