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 /yum_lighting.cginc | |
| parent | ffb4b6b861a7f4a5c2468824e16872883f64c290 (diff) | |
Introduce f2f, general purpose shared container for fragment shader
Diffstat (limited to 'yum_lighting.cginc')
| -rw-r--r-- | yum_lighting.cginc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/yum_lighting.cginc b/yum_lighting.cginc index b8dcf31..846775c 100644 --- a/yum_lighting.cginc +++ b/yum_lighting.cginc @@ -333,7 +333,7 @@ float3 applyQuasiShadows(float3 color, YumLighting light) { return result; } -YumLighting GetYumLighting(v2f i, YumPbr pbr) { +YumLighting GetYumLighting(v2f i, f2f f, YumPbr pbr) { YumLighting light = (YumLighting) 0; // normalize has no visibile impact in test scene @@ -347,9 +347,8 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) { // Calculate attenuation first, before diffuse lighting light.attenuation = getShadowAttenuation(i); - float3 binormal = cross(i.tangent, i.normal); - float3 tangentNormal = mul(pbr.normal, transpose(float3x3(i.tangent, binormal, i.normal))); - float3x3 tangentToWorld = float3x3(i.tangent, binormal, i.normal); + float3 tangentNormal = mul(pbr.normal, transpose(float3x3(i.tangent, f.binormal, i.normal))); + float3x3 tangentToWorld = float3x3(i.tangent, f.binormal, i.normal); // Use Bakery-aware irradiance function #if defined(LIGHTMAP_ON) |
