diff options
| author | yum <yum.food.vr@gmail.com> | 2023-03-23 16:32:22 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-03-23 16:52:51 -0700 |
| commit | d58d36d9ef533b526d33c511526d6e481d243c96 (patch) | |
| tree | 06fd5082841fc183246964206679c558a63aef35 /Shaders | |
| parent | 1f15133dd985442af20d42a96fbcd0007f03bd2b (diff) | |
Custom chatbox shader writes depth
This fixes issues where the transparent corners of the textbox render
in front of other materials, causing those other materials to skip
rendering.
* Update README.md with roadmap and avatar resource usage.
Diffstat (limited to 'Shaders')
| -rw-r--r-- | Shaders/TaSTT_lighting_template.cginc | 4 | ||||
| -rw-r--r-- | Shaders/TaSTT_template.shader | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Shaders/TaSTT_lighting_template.cginc b/Shaders/TaSTT_lighting_template.cginc index da3a2ec..ad488cc 100644 --- a/Shaders/TaSTT_lighting_template.cginc +++ b/Shaders/TaSTT_lighting_template.cginc @@ -524,9 +524,10 @@ float prng(float2 v) return res * res; } -fixed4 frag(v2f i) : SV_Target +fixed4 frag(v2f i, out float depth : SV_DepthLessEqual) : SV_Target { float2 uv = i.uv.zw; + depth = 1.0; // Fix text orientation uv.y = 0.5 - uv.y; @@ -546,6 +547,7 @@ fixed4 frag(v2f i) : SV_Target return light(i, margin_effect(i)); } if (InMarginRounding(uv, uv_margin, Margin_Rounding_Scale, /*interior=*/false)) { + depth = 0.0; return fixed4(0, 0, 0, 0); } } diff --git a/Shaders/TaSTT_template.shader b/Shaders/TaSTT_template.shader index e92a1bd..823eb67 100644 --- a/Shaders/TaSTT_template.shader +++ b/Shaders/TaSTT_template.shader @@ -55,9 +55,11 @@ "LightMode" = "ForwardBase"
}
Blend SrcAlpha OneMinusSrcAlpha
+ ZWrite On
+ ZTest LEqual
CGPROGRAM
- #pragma target 3.0
+ #pragma target 5.0
#pragma multi_compile _ VERTEXLIGHT_ON
@@ -76,10 +78,11 @@ "Queue"="AlphaTest+499"
}
Blend One One
- ZWrite Off
+ ZWrite On
+ ZTest LEqual
CGPROGRAM
- #pragma target 3.0
+ #pragma target 5.0
#pragma multi_compile_fwdadd
|
