From 610607592438452e181eba98f05d58f838975266 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 24 Feb 2026 18:22:33 -0800 Subject: Bugfix: spherical harmonics L0 was being added twice --- lighting.cginc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lighting.cginc') diff --git a/lighting.cginc b/lighting.cginc index cae24d0..f39d866 100755 --- a/lighting.cginc +++ b/lighting.cginc @@ -148,7 +148,7 @@ float3 yumSH9(float4 n, float3 worldPos, inout LightIndirect light) { // L0+L1: dot4 per channel (n.w=1 picks up the L0 term from SHA*.w) // L2: four quadratic terms packed into vB via swizzle multiply, plus L22 float3 L0 = float3(unity_SHAr.w, unity_SHAg.w, unity_SHAb.w); - float3 L1 = float3(dot(unity_SHAr, n), dot(unity_SHAg, n), dot(unity_SHAb, n)); + float3 L1 = float3(dot(unity_SHAr, n.xyz), dot(unity_SHAg, n.xyz), dot(unity_SHAb, n.xyz)); float4 vB = n.xyzz * n.yzzx; float3 L2 = float3(dot(unity_SHBr, vB), dot(unity_SHBg, vB), dot(unity_SHBb, vB)) + unity_SHC * (n.x * n.x - n.y * n.y); -- cgit v1.2.3