Wrap numbers around power of 2 borders
I was working yesterday on some texture sampler, and recalled a simple thingy that was a great help back in the 90′s, which I completely forgot in recent years. If you have a counter, sampler or whatever that has to get wrapped around e.g. 256, 512 or any other power of two, you can use [...]