diff options
| author | yum <yum.food.vr@gmail.com> | 2025-02-23 17:37:51 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-02-23 17:37:51 -0800 |
| commit | 16d416134ae155a3f0dacfbbe80fb26a998ec9db (patch) | |
| tree | bbedb18f57625ea050107fe9888dc8bf39c03b78 /2ner.cginc | |
| parent | 63e32a6fc92baecea75942d9389c9fb17540277d (diff) | |
begin work on stencil+pass-based eye clipping
Diffstat (limited to '2ner.cginc')
| -rw-r--r-- | 2ner.cginc | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -21,6 +21,12 @@ v2f vert(appdata v) { // hide outlines when not locked.
return (v2f) (0.0/0.0);
#endif
+#if defined(MASKED_STENCIL_PASS)
+ float masked_stencil_mask = _Masked_Stencil_Mask.SampleLevel(linear_repeat_s, v.uv01, 0);
+ if (masked_stencil_mask < 0.5) {
+ return (v2f) (0.0/0.0);
+ }
+#endif
v2f o;
@@ -108,6 +114,9 @@ float4 frag(v2f i) : SV_Target { #if defined(_EYE_EFFECT_00)
pbr.normal = eye_effect_00.normal;
#endif
+#if defined(EXTRA_STENCIL_COLOR_PASS)
+ pbr.albedo = _ExtraStencilColor;
+#endif
UNITY_BRANCH
if (_Mode == 1) {
@@ -119,7 +128,7 @@ float4 frag(v2f i) : SV_Target { applyMatcapsAndRimLighting(i, pbr);
#endif
-#if defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS) || defined(OUTLINE_PASS)
+#if defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS) || defined(OUTLINE_PASS) || defined(EXTRA_STENCIL_COLOR_PASS)
YumLighting l = GetYumLighting(i, pbr);
float4 lit = YumBRDF(i, l, pbr);
@@ -131,7 +140,7 @@ float4 frag(v2f i) : SV_Target { UNITY_EXTRACT_FOG_FROM_EYE_VEC(i);
UNITY_APPLY_FOG(_unity_fogCoord, lit.rgb);
return lit;
-#elif defined(SHADOW_CASTER_PASS)
+#elif defined(SHADOW_CASTER_PASS) || defined(MASKED_STENCIL_PASS)
return 0;
#endif
}
|
