Skip to content

Commit

Permalink
don't square GGX alpha twice
Browse files Browse the repository at this point in the history
  • Loading branch information
szellmann committed May 10, 2024
1 parent 2ba142e commit e00a3fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions renderer/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ inline vec3 evalPhysicallyBasedMaterial(const dco::Material &mat,
mat.asPhysicallyBased.clearcoatRoughness, geom, samplers, primID, uv);
const float ior = mat.asPhysicallyBased.ior;

const float alpha = roughness*roughness;
const float alpha = roughness;

constexpr float EPS = 1e-14f;
const vec3 H = normalize(lightDir+viewDir);
Expand Down Expand Up @@ -743,7 +743,7 @@ inline vec3 evalPhysicallyBasedMaterial(const dco::Material &mat,
vec3 specularBRDF = (F * D * G) / max(EPS,denom);

// Clearcoat
float Dc = D_GGX(NdotH, clearcoatRoughness * clearcoatRoughness);
float Dc = D_GGX(NdotH, clearcoatRoughness);
float Vc = V_Kelemen(LdotH, EPS);
float Fc = F_Schlick(VdotH, 0.04f) * clearcoat;
float Frc = (Dc * Vc) * Fc;
Expand Down

0 comments on commit e00a3fe

Please sign in to comment.