diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-08-11 02:25:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-08-11 02:26:05 +0300 |
commit | c4201e57f36e7a5bcb711bd1a92d5b334cd40dff (patch) | |
tree | fad2583b5a05a63f9713c9e4b23857ab376761f7 /source | |
parent | aa575a3152ade77db68a6420fc978158c34d8dd9 (diff) |
Eevee: Re: Fix NaN
This should be faster and apparently more stable.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl index 520318d3134..4d2f92c6955 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -415,7 +415,9 @@ float F_eta(float eta, float cos_theta) /* Fresnel */ vec3 F_schlick(vec3 f0, float cos_theta) { - float fac = pow(1.0 - cos_theta, 5); + float fac = 1.0 - cos_theta; + float fac2 = fac * fac; + fac = fac2 * fac2 * fac; /* Unreal specular matching : if specular color is below 2% intensity, * (using green channel for intensity) treat as shadowning */ |