diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-04-20 16:55:31 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-04-20 17:07:45 +0300 |
commit | 4cf60a2abf2b862788daf9b0874b5c99e9d57b65 (patch) | |
tree | 2057b13c868027c0737fb40b4530267191324ab1 /source/blender/draw/intern | |
parent | 2125ee4305c0f22c2c30795669b0f38404e4eb72 (diff) |
Fix T87369 EEVEE: Ambient Oclussion: Firefly caused by degenerated normal
This was caused by some sort of degenerated normals.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/shaders/common_math_lib.glsl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/intern/shaders/common_math_lib.glsl b/source/blender/draw/intern/shaders/common_math_lib.glsl index 378f27056fa..33deae0b0a1 100644 --- a/source/blender/draw/intern/shaders/common_math_lib.glsl +++ b/source/blender/draw/intern/shaders/common_math_lib.glsl @@ -91,6 +91,9 @@ vec2 sqr(vec2 a) { return a * a; } vec3 sqr(vec3 a) { return a * a; } vec4 sqr(vec4 a) { return a * a; } +/* Use manual powers for fixed powers. pow() can have unpredicatble results on some implementations. + * (see T87369, T87541) */ +float pow6(float x) { return sqr(sqr(x) * x); } float pow8(float x) { return sqr(sqr(sqr(x))); } float len_squared(vec3 a) { return dot(a, a); } |