forked from bartvdbraak/blender
Fix T43380 modulo operation in GLSL does not return negatives.
Make it so by checking operand sign.
This commit is contained in:
parent
8186214c39
commit
3ff9e52dca
@ -297,6 +297,10 @@ void math_modulo(float val1, float val2, out float outval)
|
||||
outval = 0.0;
|
||||
else
|
||||
outval = mod(val1, val2);
|
||||
|
||||
/* 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) ? outval : -outval;
|
||||
}
|
||||
|
||||
void math_abs(float val1, out float outval)
|
||||
|
Loading…
Reference in New Issue
Block a user