summaryrefslogtreecommitdiffstats
path: root/3ner.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-01-17 17:35:13 -0800
committeryum <yum.food.vr@gmail.com>2026-01-17 17:37:06 -0800
commitb925b4b1bf79e3d6f930a4d799a7194673b62bde (patch)
tree1c45dbf95f66c4948ef6bcf64d9622b259fce624 /3ner.cginc
parentc6923a553c98da7805407fe1fbfdb6c69c8d7530 (diff)
Impostors: continue work on depth, getting closer
Diffstat (limited to '3ner.cginc')
-rw-r--r--3ner.cginc15
1 files changed, 2 insertions, 13 deletions
diff --git a/3ner.cginc b/3ner.cginc
index ab80a8d..18c23ee 100644
--- a/3ner.cginc
+++ b/3ner.cginc
@@ -258,7 +258,7 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
#endif
) : SV_Target {
UNITY_SETUP_INSTANCE_ID(i);
-#if defined(SHADOW_CASTER_PASS)
+#if defined(SHADOW_CASTER_PASS) && !(_IMPOSTORS)
return 0;
#endif
@@ -281,18 +281,9 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
i.normal = pbr.normal;
i.objPos = pbr.objPos;
propagateObjPos(i);
+
float4 imp_clip_pos = UnityObjectToClipPos(i.objPos);
depth = imp_clip_pos.z / imp_clip_pos.w;
- if (false) {
- depth *= 100;
- depth *= depth;
- depth *= depth;
- depth *= 100;
- return float4(depth, depth, depth, 1);
- }
- if (false) {
- return float4(i.objPos, 1);
- }
#endif
#if defined(_DEBUG_VIEW_UNLIT)
@@ -304,7 +295,6 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
#elif defined(_DEBUG_VIEW_DEPTH)
float2 screen_uv = i.pos.xy / _ScreenParams.xy;
float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, screen_uv);
- depth = 1.0f - depth;
depth *= 100;
depth *= depth;
depth *= depth;
@@ -323,4 +313,3 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
}
#endif // __3NER_INC
-