diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-02 07:44:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-02 07:45:19 +0300 |
commit | 4a85089abe6d5abb9f6bb0d8255eba33dc030fcb (patch) | |
tree | 25459e54af9cf6712ca349b924319939ba853909 /source/blender/gpu/shaders | |
parent | cf6e45b5224d16263d7c87411a2ff71ed928410f (diff) | |
parent | 765e28948e706d8fce97c23d4d050a607971488b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/gpu/shaders')
-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 afb5eca5263..44803f8f7ee 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2578,7 +2578,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); |