diff options
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; |
