Fix T52152: allow zero roughness for Cycles principled BSDF, don't clamp.

This commit is contained in:
Brecht Van Lommel 2017-07-22 21:38:44 +02:00
parent ec831ee7d1
commit e982ebd6d4
Notes: blender-bot 2023-02-14 10:21:10 +01:00
Referenced by issue #52184, Driven key sticks on certain values
Referenced by issue #52152, Blurry reflections from mirror surface when using Principled BSDF in Blender 2.79 test build
Referenced by issue #52163, carve boolean modifier make some files impossible to open or very unstable.
2 changed files with 4 additions and 4 deletions

View File

@ -76,8 +76,8 @@ shader node_principled_bsdf(
float aspect = sqrt(1.0 - Anisotropic * 0.9);
float r2 = Roughness * Roughness;
float alpha_x = max(0.001, r2 / aspect);
float alpha_y = max(0.001, r2 * aspect);
float alpha_x = r2 / aspect;
float alpha_y = r2 * aspect;
color tmp_col = color(1.0, 1.0, 1.0) * (1.0 - SpecularTint) + m_ctint * SpecularTint;

View File

@ -280,8 +280,8 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
float aspect = safe_sqrtf(1.0f - anisotropic * 0.9f);
float r2 = roughness * roughness;
bsdf->alpha_x = fmaxf(0.001f, r2 / aspect);
bsdf->alpha_y = fmaxf(0.001f, r2 * aspect);
bsdf->alpha_x = r2 / aspect;
bsdf->alpha_y = r2 * aspect;
float m_cdlum = 0.3f * base_color.x + 0.6f * base_color.y + 0.1f * base_color.z; // luminance approx.
float3 m_ctint = m_cdlum > 0.0f ? base_color / m_cdlum : make_float3(0.0f, 0.0f, 0.0f); // normalize lum. to isolate hue+sat