diff --git a/OpenDreamClient/Rendering/DreamPlane.cs b/OpenDreamClient/Rendering/DreamPlane.cs index d91d2b9b2f..74bc93f99c 100644 --- a/OpenDreamClient/Rendering/DreamPlane.cs +++ b/OpenDreamClient/Rendering/DreamPlane.cs @@ -62,8 +62,6 @@ public void Draw(DreamViewOverlay overlay, DrawingHandleWorld handle, Box2 world handle.UseShader(overlay.GetBlendAndColorShader(Master, useOverlayMode: true)); handle.SetTransform(DreamViewOverlay.CreateRenderTargetFlipMatrix(_temporaryRenderTarget.Size, Vector2.Zero)); handle.DrawTextureRect(mainRenderTarget.Texture, new Box2(Vector2.Zero, mainRenderTarget.Size)); - handle.SetTransform(Matrix3.Identity); - handle.UseShader(null); }, new Color()); } } diff --git a/OpenDreamClient/Rendering/DreamViewOverlay.cs b/OpenDreamClient/Rendering/DreamViewOverlay.cs index dcfd14118e..367bff6ec6 100644 --- a/OpenDreamClient/Rendering/DreamViewOverlay.cs +++ b/OpenDreamClient/Rendering/DreamViewOverlay.cs @@ -802,18 +802,19 @@ private void DrawIconSlow(DrawingHandleWorld handle, Texture frame, RendererMeta IRenderTexture ping = RentRenderTarget(frame.Size * 2); IRenderTexture pong = RentRenderTarget(ping.Size); - //we can use the color matrix shader here, since we don't need to blend - //also because blend mode is none, we don't need to clear - var colorMatrix = iconMetaData.ColorMatrixToApply.Equals(ColorMatrix.Identity) - ? new ColorMatrix(iconMetaData.ColorToApply.WithAlpha(iconMetaData.AlphaToApply)) - : iconMetaData.ColorMatrixToApply; - - ShaderInstance colorShader = _colorInstance.Duplicate(); - colorShader.SetParameter("colorMatrix", colorMatrix.GetMatrix4()); - colorShader.SetParameter("offsetVector", colorMatrix.GetOffsetVector()); - colorShader.SetParameter("isPlaneMaster",iconMetaData.IsPlaneMaster); - handle.UseShader(colorShader); handle.RenderInRenderTarget(pong, () => { + //we can use the color matrix shader here, since we don't need to blend + //also because blend mode is none, we don't need to clear + var colorMatrix = iconMetaData.ColorMatrixToApply.Equals(ColorMatrix.Identity) + ? new ColorMatrix(iconMetaData.ColorToApply.WithAlpha(iconMetaData.AlphaToApply)) + : iconMetaData.ColorMatrixToApply; + + ShaderInstance colorShader = _colorInstance.Duplicate(); + colorShader.SetParameter("colorMatrix", colorMatrix.GetMatrix4()); + colorShader.SetParameter("offsetVector", colorMatrix.GetOffsetVector()); + colorShader.SetParameter("isPlaneMaster",iconMetaData.IsPlaneMaster); + handle.UseShader(colorShader); + handle.SetTransform(CreateRenderTargetFlipMatrix(pong.Size, frame.Size / 2)); handle.DrawTextureRect(frame, new Box2(Vector2.Zero, frame.Size)); }, Color.Black.WithAlpha(0)); @@ -821,8 +822,9 @@ private void DrawIconSlow(DrawingHandleWorld handle, Texture frame, RendererMeta foreach (DreamFilter filterId in iconMetaData.MainIcon!.Appearance!.Filters) { ShaderInstance s = _appearanceSystem.GetFilterShader(filterId, RenderSourceLookup); - handle.UseShader(s); // Set the shader out here to avoid a closure alloc handle.RenderInRenderTarget(ping, () => { + handle.UseShader(s); + // Technically this should be ping.Size, but they are the same size so avoid the extra closure alloc var transform = CreateRenderTargetFlipMatrix(pong.Size, Vector2.Zero);