summaryrefslogtreecommitdiffstats
path: root/brdf.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-03-03 18:24:18 -0800
committeryum <yum.food.vr@gmail.com>2026-03-03 18:24:18 -0800
commite28c2aa1eaf537276e5667b23d8d35b001200d31 (patch)
treea25e6339c8e80065c478aa5319f5b8b9eeb9e06d /brdf.cginc
parent23014acf1bd834744018425e7aeba314a10e12f9 (diff)
Fix reflection dir, matching filament
Diffstat (limited to 'brdf.cginc')
-rwxr-xr-xbrdf.cginc3
1 files changed, 2 insertions, 1 deletions
diff --git a/brdf.cginc b/brdf.cginc
index ee1a219..9e08325 100755
--- a/brdf.cginc
+++ b/brdf.cginc
@@ -70,6 +70,7 @@ float4 brdf(Pbr pbr, LightData data) {
float3 specular = 0;
float3 diffuse = 0;
+ // TODO parameterize
float f0 = 0.04f;
const float f90 = 1.0f;
@@ -94,7 +95,7 @@ float4 brdf(Pbr pbr, LightData data) {
dfg = float3(1, 1, 1);
}
float3 f0_color = lerp(f0, pbr.albedo.xyz, pbr.metallic);
- float3 energy_comp = 1.0f + f0_color * (1.0f / dfg.xxx - 1.0f);
+ float3 energy_comp = 1.0f + f0_color * (1.0f / (dfg.xxx + dfg.yyy) - 1.0f);
#if defined(_CLEARCOAT)
const float cc_f0 = 0.04f;