Commit: 8a338950c6ddde37ddefadd75c39d4d2efc7aee3
Author: Clément Foucault
Date:   Sat Aug 10 23:29:50 2019 +0200
Branches: master
https://developer.blender.org/rB8a338950c6ddde37ddefadd75c39d4d2efc7aee3

Fix T68537 Eevee: Modulo node behaves unexpectedly/inconsistently

There was still some float imprecision when both input values are equal.

===================================================================

M       source/blender/gpu/shaders/gpu_shader_material.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl 
b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 66d8bf996ba..83d008c3441 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -379,7 +379,7 @@ void math_greater_than(float val1, float val2, out float 
outval)
 
 void math_modulo(float val1, float val2, out float outval)
 {
-  if (val2 == 0.0) {
+  if (val2 == 0.0 || val1 == val2) {
     outval = 0.0;
   }
   else {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to