Fix T51434: Module math operation is wrong in GLSL shading

Based on patch from @lazydodo.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2661
This commit is contained in:
2017-05-09 12:31:19 +02:00
committed by Sergey Sharybin
parent 06b2f10ad1
commit ffc95a33b6

View File

@@ -403,7 +403,7 @@ void math_modulo(float val1, float val2, out float outval)
/* change sign to match C convention, mod in GLSL will take absolute for negative numbers,
* see https://www.opengl.org/sdk/docs/man/html/mod.xhtml */
outval = (val1 > 0.0) ? outval : -outval;
outval = (val1 > 0.0) ? outval : outval - val2;
}
void math_abs(float val1, out float outval)