From 228e555dbd07dd1a332a07770106dfd98f918c9b Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 12 Oct 2025 21:52:50 -0700 Subject: fornite update --- brdf.cginc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'brdf.cginc') diff --git a/brdf.cginc b/brdf.cginc index d89558c..8352c08 100644 --- a/brdf.cginc +++ b/brdf.cginc @@ -138,7 +138,7 @@ float4 brdf(Pbr pbr, LightData data) { // Direct { - float remainder = 1.0f; + float3 remainder = 1.0f; #if defined(_CLEARCOAT) float cc_f0 = 0.04f; @@ -149,7 +149,7 @@ float4 brdf(Pbr pbr, LightData data) { float3 direct_specular_cc = DFGcc * data.direct.color * data.direct.NoL_cc * pbr.cc_strength; direct_specular_cc = max(0, direct_specular_cc); specular += direct_specular_cc; - remainder -= Fcc * pbr.cc_strength; + remainder = saturate(remainder - direct_specular_cc); #endif #if defined(_CLOTH_SHEEN) @@ -173,7 +173,7 @@ float4 brdf(Pbr pbr, LightData data) { float3 direct_specular = FDG * remainder * data.direct.color * data.direct.NoL * lerp(1.0f, pbr.albedo.xyz, pbr.metallic); direct_specular = max(0, direct_specular); specular += direct_specular; - remainder -= F; + remainder = saturate(remainder - direct_specular); float Fd = Fd_OrenNayar(pbr.roughness, data.common.NoV, data.direct.NoL, data.direct.LoV) / PI; float3 direct_diffuse = Fd * remainder * (1.0f - pbr.metallic) * pbr.albedo.xyz * data.direct.color; @@ -184,7 +184,7 @@ float4 brdf(Pbr pbr, LightData data) { // Indirect #if defined(FORWARD_BASE_PASS) { - float remainder = 1.0f; + float3 remainder = 1.0f; float2 dfg_uv = float2(pbr.roughness, data.common.NoV); #if defined(_CLEARCOAT) @@ -192,7 +192,7 @@ float4 brdf(Pbr pbr, LightData data) { float Fcc = F_Schlick(data.common.NoV, cc_f0, 1.0f); float3 indirect_specular_cc = Fcc * data.indirect.specular_cc * pbr.cc_strength; specular += indirect_specular_cc; - remainder -= Fcc * pbr.cc_strength; + remainder = saturate(remainder - indirect_specular_cc); #endif #if defined(_CLOTH_SHEEN) -- cgit v1.2.3