diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-11-01 19:12:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-11-01 19:14:06 +0300 |
commit | 07dbff7dc1d5cfca9fbfb74204a2298e16d471b4 (patch) | |
tree | a3fb96aacd5092ddd17da140416686d1c502167c /source/blender | |
parent | 71f46bc3679039af358f905abf16b77f0d89bc57 (diff) |
Fix T53217: GLSL principled BSDF black with zero clearcoat roughness.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 3dbecc58a7e..ce696706628 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2524,7 +2524,11 @@ float schlick_fresnel(float u) float GTR1(float NdotH, float a) { - if (a >= 1.0) return M_1_PI; + if (a >= 1.0) { + return M_1_PI; + } + + a = max(a, 0.001); float a2 = a*a; float t = 1.0 + (a2 - 1.0) * NdotH*NdotH; return (a2 - 1.0) / (M_PI * log(a2) * t); |