]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix displacement map rendering in UI (#38042)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Tue, 24 Jun 2025 20:47:29 +0000 (22:47 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Jun 2025 20:47:29 +0000 (22:47 +0200)
Fix displacement map rendering

918709cb4742d02e9822a651cf8e74727ba997de changed the way humans work to completely remove the stencil mask thing for clothing cutouts, in favor of displacement maps. Except it didn't actually remove the stencil parameters from the shader prototype, so this caused the shader to render incorrectly in SpriteView instances.

I introduced a new DisplacedDraw shader that doesn't have the stencil in use, as removing the old one would probably be a more annoying breaking change.

Fixes #37629

Content.Client/Holopad/HolopadSystem.cs
Content.Shared/DisplacementMap/DisplacementData.cs
Resources/Prototypes/Shaders/displacement.yml

index f219e1577d7c9a78b7ff5deea7a34cd849d54821..9fc08155169fde35a95814be235fd3e035f1f8ad 100644 (file)
@@ -107,7 +107,7 @@ public sealed class HolopadSystem : SharedHolopadSystem
         // Remove shading from all layers (except displacement maps)
         for (var i = 0; i < hologramSprite.AllLayers.Count(); i++)
         {
-            if (_sprite.TryGetLayer((hologram, hologramSprite), i, out var layer, false) && layer.ShaderPrototype != "DisplacedStencilDraw")
+            if (_sprite.TryGetLayer((hologram, hologramSprite), i, out var layer, false) && layer.ShaderPrototype != "DisplacedDraw")
                 hologramSprite.LayerSetShader(i, "unshaded");
         }
 
index 7bd5b580e143c3bca8c4ad6c1bb3a6db1006ec67..6564f720a8e3c6409d256e4d0c6ba7c7756a8c03 100644 (file)
@@ -10,5 +10,5 @@ public sealed partial class DisplacementData
     public Dictionary<int, PrototypeLayerData> SizeMaps = new();
 
     [DataField]
-    public string? ShaderOverride = "DisplacedStencilDraw";
+    public string? ShaderOverride = "DisplacedDraw";
 }
index 5c90738008348b8c7b0236fbe726d9cd8c21b72d..70c9dce6f79a5d1c288accf3dbbae381c737eabb 100644 (file)
@@ -8,3 +8,10 @@
     func: NotEqual
   params:
     displacementSize: 127
+
+- type: shader
+  id: DisplacedDraw
+  kind: source
+  path: "/Textures/Shaders/displacement.swsl"
+  params:
+    displacementSize: 127