3 ms·
The doom square root trick. Reducing an expensive function to almost nothing with low error. Many writeups on the web far better than I could give.
The doom square root trick. Reducing an expensive function to almost nothing with low error. Many writeups on the web far better than I could give.
I think you mean quakes fast inverse square root? Not aware doom had a clever sqrt routine, but I would be happy to be wrong!
obligatory //what the fuck?
You’re right. Doom used fixed-point math; at the time, hardware floating-point units were far from ubiquitous on the computers people wanted to use to play it.
*Quake
Doom redefining a circle to be 256 degrees, so that the angle calculations fit into one byte.