Fix frozen rim pixels via GPU coverage stamp; add brush masks
Replace the CPU island-mask dilation guard on the GPU backend with a coverage pass rendered through the same brush rasterizer, so sub-pixel rim texels that the GPU brush can never reach fall into the gutter and stay paintable (no more frozen loaded pixels at island edges). Also includes user content: additional brush masks (dirt) with an expanded mask selector in the HUD prefab, and CharacterController / wall-climb inspector tuning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c14525a2c8
commit
fa7082817e
8 files changed
+986
-16
No files matched your search
@@ -103,6 +103,42 @@ Shader "Hidden/MeshPaintBrush"
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Pass 1 - coverage: rasterizes the mesh in UV space (identical vertex transform to
|
||||
// the brush) and writes alpha = 1 on exactly the texels the brush can paint. Used to
|
||||
// seed the dilation guard (display RT alpha) so it matches the GPU rasterizer instead
|
||||
// of a CPU point-in-triangle approximation. Texels the brush can never reach (sub-pixel
|
||||
// island borders) stay alpha = 0 -> the gutter, so dilation can still overpaint them.
|
||||
Pass
|
||||
{
|
||||
ZTest Always
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
Blend Off
|
||||
ColorMask A
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; };
|
||||
struct v2f { float4 pos : SV_POSITION; };
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
float2 p = v.uv * 2.0 - 1.0;
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
p.y = -p.y;
|
||||
#endif
|
||||
o.pos = float4(p, 0.0, 1.0);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target { return fixed4(0, 0, 0, 1); }
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
Fallback Off
|
||||
}
|
||||
Reference in new issue
Block a user