summaryrefslogtreecommitdiffstats
path: root/2ner.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-06-15 15:03:22 -0700
committeryum <yum.food.vr@gmail.com>2025-06-15 15:03:22 -0700
commit478cb4e07622488915132c8de2f52dc5c19bb6c0 (patch)
treeb2f88ee10edc9c983fc2ea30ed9e16bdd38c9737 /2ner.cginc
parentb57eb0894b8abef05db7648addf089cdd3773b54 (diff)
Touch up shadows
Diffstat (limited to '2ner.cginc')
-rw-r--r--2ner.cginc17
1 files changed, 13 insertions, 4 deletions
diff --git a/2ner.cginc b/2ner.cginc
index dad0c84..a6d9dc3 100644
--- a/2ner.cginc
+++ b/2ner.cginc
@@ -1,6 +1,9 @@
#ifndef __2NER_INC
#define __2NER_INC
+#define HANDLE_SHADOWS_BLENDING_IN_GI
+
+#include "UnityStandardCoreMinimal.cginc"
#include "UnityCG.cginc"
#include "UnityLightingCommon.cginc"
#include "AutoLight.cginc"
@@ -186,15 +189,13 @@ v2f vert(appdata v) {
o.tangent = v.tangent.xyz;
o.binormal = cross(o.normal, o.tangent) * v.tangent.w;
- UNITY_TRANSFER_LIGHTING(o, v.uv0);
+ UNITY_TRANSFER_LIGHTING(o, v.uv1);
UNITY_TRANSFER_FOG_COMBINED_WITH_EYE_VEC(o, o.pos);
#if defined(SHADOW_CASTER_PASS)
TRANSFER_SHADOW_CASTER_NORMALOFFSET(o);
#endif
-#if defined(SHADOWS_SCREEN)
TRANSFER_SHADOW(o);
-#endif
// Vertex color
o.color = v.color;
@@ -460,7 +461,15 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
UNITY_APPLY_FOG(_unity_fogCoord, lit.rgb);
return lit;
-#elif defined(SHADOW_CASTER_PASS) || defined(MASKED_STENCIL1_PASS) || defined(MASKED_STENCIL2_PASS) || defined(MASKED_STENCIL3_PASS) || defined(MASKED_STENCIL4_PASS) || defined(DEPTH_PREPASS)
+#elif defined(SHADOW_CASTER_PASS)
+ // Apply dithering for LOD if needed
+ #ifdef LOD_FADE_CROSSFADE
+ UnityApplyDitherCrossFade(i.pos.xy);
+ #endif
+
+ // Output proper shadow data
+ SHADOW_CASTER_FRAGMENT(i)
+defined(MASKED_STENCIL1_PASS) || defined(MASKED_STENCIL2_PASS) || defined(MASKED_STENCIL3_PASS) || defined(MASKED_STENCIL4_PASS) || defined(DEPTH_PREPASS)
return 0;
#endif
}