diff options
| author | yum <yum.food.vr@gmail.com> | 2026-03-03 18:24:18 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-03-03 18:24:18 -0800 |
| commit | e28c2aa1eaf537276e5667b23d8d35b001200d31 (patch) | |
| tree | a25e6339c8e80065c478aa5319f5b8b9eeb9e06d /brdf.cginc | |
| parent | 23014acf1bd834744018425e7aeba314a10e12f9 (diff) | |
Fix reflection dir, matching filament
Diffstat (limited to 'brdf.cginc')
| -rwxr-xr-x | brdf.cginc | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |
