From d24a5d839bad7ae0a9a6525f7c4d30fa0877e073 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 20 Jan 2026 22:07:45 -0800 Subject: Introduce f2f, general purpose shared container for fragment shader --- yum_lighting.cginc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'yum_lighting.cginc') 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) -- cgit v1.2.3