diff options
| author | yum <yum.food.vr@gmail.com> | 2026-03-24 18:23:53 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-03-24 18:23:53 -0700 |
| commit | 58a8ad92f766baddb2c832597a43088def456d82 (patch) | |
| tree | 5a8b6868847ecd7234e7b52992be002abef6b281 /lighting.cginc | |
| parent | 81637c1a3fab4f92e6da7517dd118d5bb4526865 (diff) | |
Refactor ssdf and matcaps/rl into "late pbr" stage; implement ssdf shadows
Diffstat (limited to 'lighting.cginc')
| -rwxr-xr-x | lighting.cginc | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |
