4 ms·
Ternary is a thing; however, there's a lot of times when you're hand-rolling a compression scheme. In those cases, it is common to consider all sorts of nonstan
by thechao 2y ago
Ternary is a thing; however, there's a lot of times when you're hand-rolling a compression scheme. In those cases, it is common to consider all sorts of nonstandard bases. So, for instance, if you need to encode a pair of numbers, and that pair is in the (rectangular) range: `[0,2]*[0,4]`, then it can be efficiently encoded in a 4b value, using the generalized version of the technique outlined in the article. I know that a lot of GPU block textures rely pretty heavily on products-of-weird-bases, usually 3, 5, and 7. Here's some 'good' combinations (high utilization rates, easy to decode):
3^5 ~ 8b
5^3 ~ 7b
2 * 5 * 7^2 ~ 9b
2 * 3 * 5 ~ 5b
11 * 11 ~ 7b
3 * 5 * 7 ~ 7b
etc.
- taeric 2y agoYeah, I was making the mistake of thinking this was storing ternary in a BCD like scheme. I... honestly don't know how I talked myself into that.
- hinkley 2y agoDoom also famously redefined a circle as 256° and reworked all of their trigonometry and polar coordinate translations to match. And so the smallest increment of angle you could do in the game was around 85 arc minutes.
- kristianp 2y ago> famously redefined a circle as 256° Famously? Where can I read about Doom's odd trigonometry?
- kristianp 2y agoI found one reference here: https://www.doomworld.com/forum/topic/103245-question-about-the-trigonometry-in-the-doom-source/ https://www.doomworld.com/forum/topic/103245-question-about-...