Submitted by newsphilosophy t3_yxpgwk in space
framingXjake t1_iwq8hbj wrote
Reply to comment by DefectiveSp00n in Dark matter may be information itself by newsphilosophy
I believe the game was Quake III Arena, but there was a physics engine gravity problem in the development phase of the game. They needed a way to calculate inverse roots (i = 1/√x) quickly, but couldn't do it since you pretty much always get long ass floating point numbers which aren't very accurate sometimes, especially with roots and fractions. So some guy on the dev team came about some ass-backwards solution that makes absolutely zero sense in any regard, but somehow still worked nearly flawlessly. He fixed the games gravity with math that doesn't make any fucking sense whatsoever. If you scroll through the games code to find these lines of physics engine voodoo fuckery, the dev team left a comment that literally says "what the fuck?" If we can find the dev who solved that problem, maybe we can get him to answer our dark matter questions.
https://medium.com/five-guys-facts/the-fast-inverse-square-root-7f9e1fbaa2d
edit: Correction, the calculation was for lighting and reflection effects. My mistake, I heard most of this story secondhand from a professor I had in college.
Kriegenstein t1_iwqo1yy wrote
It was used in lighting and reflection calculations, not gravity. Still cool though.
[deleted] t1_iwqzbv4 wrote
[removed]
DeltaV-Mzero t1_iwqbomr wrote
They do actually explain why it works in that article (thanks for the link btw!)
But I can’t imagine thinking that up, understanding it is tricky enough
framingXjake t1_iwqzaw1 wrote
Ahhh I didn't read the very end of it lol. Yeah, but the math is definitely obscure. Like who even thought of the idea of reading a single precision IEEE 754 binary number as a binary integer? That's like reading a German book even though you can only read English, and yet by the end of the book, everything somehow still makes sense.
Viewing a single comment thread. View all comments