I am trying to learn some procedural basics. Could you tell me what the fraction math node does? Is the result similar to modulo?
2 Answers
Fract returns the fractional part of a floating-point value, as described by @Merlin, but its treatment of negative fractional parts is not actually the same as Blender's implementaion of Modulo.
If you want to see what a mathematical chunk of your shader tree is doing, it can be quite handy to make it generate a graph.
Fract:
This plane is 8x8 units, with its origin, (so (0,0)), at its center. I've added the annotations, but you can see the function without them.
Modulo 1:
Thanks to @Rich Sedman for the very useful graphing tip.
- 76,260
- 8
- 77
- 190
Mathematically it should return the fractional part of the number i.e the non whole-number part, but the blender implementation is artistic in it's implementation.
For non-negative numbers this is equivalent to using the modulo with a factor of 1.0

For negative numbers it is equivalent to using modulo with a factor of -1.0

The equivalent node setup of the fraction node would be:

- 2,202
- 13
- 17


mod(x,1)andfract(x)would be the same.. it's language dependent. A gotcha, not a bug, AFAIK. – Robin Betts Nov 26 '19 at 14:14