From 12da92ff5055748dbcfdb165310a7f83a84c2228 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 23 Feb 2026 23:14:14 -0800 Subject: Adjust how bent normal strength is applied --- lighting.cginc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lighting.cginc') diff --git a/lighting.cginc b/lighting.cginc index e56bb37..2ae7d0d 100755 --- a/lighting.cginc +++ b/lighting.cginc @@ -243,11 +243,16 @@ void GetLighting(v2f i, Pbr pbr, out LightData data) { ao_vis = pbr.ao; #endif #if defined(_BENT_NORMALS) - float3 spec_ao_bent = pbr.bent_normal; + float3 spec_ao_normal = pbr.bent_normal; #else - float3 spec_ao_bent = pbr.normal; + float3 spec_ao_normal = pbr.normal; #endif - data.indirect.specular *= computeSpecularAO(data.common.NoV, ao_vis, pbr.roughness, spec_ao_bent, -data.indirect.dir); + //float NoV_geom = saturate(dot(i.normal, data.common.V)); + float spec_ao = computeSpecularAO(data.common.NoV, ao_vis, pbr.roughness, spec_ao_normal, -data.indirect.dir); +#if defined(_BENT_NORMALS) + spec_ao = saturate(lerp(1.0, spec_ao, _Bent_Normals_Strength)); +#endif + data.indirect.specular *= spec_ao; #endif #if defined(_CLEARCOAT) data.indirect.specular_cc = getIndirectSpecular(i, saturate(sqrt(pbr.cc_roughness)), view_dir, dir_cc); -- cgit v1.2.3