From 58a8ad92f766baddb2c832597a43088def456d82 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 24 Mar 2026 18:23:53 -0700 Subject: Refactor ssdf and matcaps/rl into "late pbr" stage; implement ssdf shadows --- lighting.cginc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lighting.cginc') diff --git a/lighting.cginc b/lighting.cginc index 069abe9..0287f51 100755 --- a/lighting.cginc +++ b/lighting.cginc @@ -137,7 +137,7 @@ float4 getIndirectDiffuse(v2f i, Pbr pbr, inout LightData light) { #endif #endif -#if defined(_SHADOWS) +#if defined(_SHADOWS) || defined(_SSFD) float3x3 mat = float3x3( light.indirect.L01r, light.indirect.L01g, @@ -146,6 +146,10 @@ float4 getIndirectDiffuse(v2f i, Pbr pbr, inout LightData light) { // Multiply unit vector by L1 matrix to get vector pointing in direction of // light. float3 dom_dir = normalize(mul(mat, float3(1,1,1))); + light.indirect.diffuse_dominant_dir = dom_dir; +#endif + +#if defined(_SHADOWS) float light_amount = dot(dom_dir, pbr.normal); float3 shadow_color = lerp( _Shadow_0_Color.rgb, @@ -160,7 +164,7 @@ float4 getIndirectDiffuse(v2f i, Pbr pbr, inout LightData light) { #endif // _SHADOW_1 diffuse.xyz *= shadow_color; -#endif +#endif // _SHADOWS return diffuse; } -- cgit v1.2.3