diff --git a/src/6.pbr/1.1.lighting/1.1.pbr.fs b/src/6.pbr/1.1.lighting/1.1.pbr.fs index b5242e5..dce7c32 100644 --- a/src/6.pbr/1.1.lighting/1.1.pbr.fs +++ b/src/6.pbr/1.1.lighting/1.1.pbr.fs @@ -29,7 +29,7 @@ float DistributionGGX(vec3 N, vec3 H, float roughness) float denom = (NdotH2 * (a2 - 1.0) + 1.0); denom = PI * denom * denom; - return nom / max(denom, 0.001); // prevent divide by zero for roughness=0.0 and NdotH=1.0 + return nom / max(denom, 0.0000001); // prevent divide by zero for roughness=0.0 and NdotH=1.0 } // ---------------------------------------------------------------------------- float GeometrySchlickGGX(float NdotV, float roughness) diff --git a/src/6.pbr/1.1.lighting/lighting.cpp b/src/6.pbr/1.1.lighting/lighting.cpp index 4825c3b..11e334b 100644 --- a/src/6.pbr/1.1.lighting/lighting.cpp +++ b/src/6.pbr/1.1.lighting/lighting.cpp @@ -140,7 +140,7 @@ int main() shader.setFloat("metallic", (float)row / (float)nrRows); for (int col = 0; col < nrColumns; ++col) { - // we clamp the roughness to 0.025 - 1.0 as perfectly smooth surfaces (roughness of 0.0) tend to look a bit off + // we clamp the roughness to 0.05 - 1.0 as perfectly smooth surfaces (roughness of 0.0) tend to look a bit off // on direct lighting. shader.setFloat("roughness", glm::clamp((float)col / (float)nrColumns, 0.05f, 1.0f));