diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2014-01-14 22:58:07 +0400 |
---|---|---|
committer | Sv. Lockal <lockalsash@gmail.com> | 2014-01-14 22:58:07 +0400 |
commit | 6e8321f2c033367dc6a7d6ec305c2a27e0b62969 (patch) | |
tree | 8458d4d1d77a38939298a9bafb45e02761fa8e99 | |
parent | 1c49eb0072845cfad74bc141a8a05f875ac40430 (diff) |
Fix GLSL compatible_pow to give 1.0 for 0 ^ 0
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 3a4aa75aa01..cdb3f57ca20 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -6,6 +6,9 @@ float exp_blender(float f) float compatible_pow(float x, float y) { + if(y == 0.0) /* x^0 -> 1, including 0^0 */ + return 1.0; + /* glsl pow doesn't accept negative x */ if(x < 0.0) { if(mod(-y, 2.0) == 0.0) |