diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-20 22:07:45 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-20 22:07:45 -0800 |
| commit | d24a5d839bad7ae0a9a6525f7c4d30fa0877e073 (patch) | |
| tree | 9647d7a3a55765b556a08d5cc2cef3efbad98d42 /2ner.cginc | |
| parent | ffb4b6b861a7f4a5c2468824e16872883f64c290 (diff) | |
Introduce f2f, general purpose shared container for fragment shader
Diffstat (limited to '2ner.cginc')
| -rw-r--r-- | 2ner.cginc | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -286,12 +286,15 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace i.normal *= facing ? 1 : -1;
i.normal = UnityObjectToWorldNormal(i.normal);
- i.tangent = mul(unity_ObjectToWorld, i.tangent);
+ i.tangent = UnityObjectToWorldNormal(i.tangent);
// Not necessarily normalized after interpolation
i.normal = normalize(i.normal);
i.tangent = normalize(i.tangent);
+ f2f f = (f2f) 0;
+ f.binormal = cross(i.tangent, i.normal);
+
#if defined(_RAYMARCHED_FOG)
{
// Many fields are overspecified as .rgb or .xyz. This is because thry's
@@ -520,7 +523,7 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace #endif
#if defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS) || defined(OUTLINE_PASS) || defined(EXTRA_STENCIL_COLOR_PASS)
- YumLighting l = GetYumLighting(i, pbr);
+ YumLighting l = GetYumLighting(i, f, pbr);
#if defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS)
applyMatcapsAndRimLighting(i, pbr, l);
|
