Hi I was working on my rain material, and got into problems.
I imported and animated sprite texture and used flipbook node for it.
After applying the material, I thought the raindrops were too small/big and needs to be adjusted.
so, what I tried first was this:
Sure Frac leaves only the fractional part of a number. For example, if you provide:
2.9…3.0…3.1…3.2…3.3
it will return:
0.9…0.0…0.1…0.2…0.3.
This way, the previously multiplied UVs will be always 0-1 after frac. While it doesn’t matter for the regular texture sampler (it wraps UVs automatically), it makes a difference for the SubUV_Function / Flipbook node.
Using frac has one disadvantage - it breaks the continuity of the UVs between the 0.999 and 0.0. A texture sampler would most likely produce a blurred 2-pixel seam in such places. In other words, when frac on UVs is not needed, it’s better to avoid it - and let the texture sampler do the wrapping automatically. But that’s another, long story, about derivatives, DDX / DDY and such.