Origin of Quake3's InvSqrt()

Rys

Graphics @ AMD
Moderator
Veteran
Supporter
Aaaaages ago I did some digging on just where the InvSqrt function in Quake 3's source code came from. It was talked about on these very forums back in the day, that very thread part of my inspiration to brave Outlook and Google and see what was what.

The result is thus, where you'll find me conversing with JC (steady on now, Rev), Mr. T-Buffer, and the mighty Terje Mathison to get to the bottom of it.

One for the real nerds and hackers among us, with a bit of history* to boot. Enjoy.

* You really can't write these things without invoking 3dfx; it's the law!
 
  • Like
Reactions: Geo
quincy.jpg


It's Rys!
 
BTW,
Rys said:
where you'll find me conversing with JC (steady on now, Rev),
I am honestly delighted John responded to your question. He usually isn't too talkative when replying to "strangers", they're usually one-sentence replies but that one sentence usually is a to-the-point answer instead of being as verbose as, say, Tim Sweeney. He also almost never answer emails that demands more than 2 minutes of thinking-before-reply :)
 
What's this? Good ole techie/dweeby stuff in this forum fighting for some attention with all the social drama in the AEG thread? Nice to see! :LOL:

I suppose I'm biased because I had a chance to preview this, but I really do appreciate the accessibility you bring to these kinds of topics. Even tech thicky's like me can follow along.
 
Interesting read! However, Rys, you made a couple of typos:

The magic of the code, even if you can't follow it, stands out as the i = 0x5f3759df - (i >1); line.
should read
The magic of the code, even if you can't follow it, stands out as the i = 0x5f3759df - (i >> 1); line.
as the two mean very different things!

There are a few other spelling ones, but nothing major :)
 
Diplo said:
Interesting read! However, Rys, you made a couple of typos:
Eek, will fix! Feel free to point out the typos, this'll get republished properly at some point :smile:
 
Reverend said:
I am honestly delighted John responded to your question. He usually isn't too talkative when replying to "strangers"
Come on,

I mailed JC, the other day about what type of Pizzas I should get delivered when I watch a DVD, and and he replied with a 10K words email on the subject based on his personal tests of Domino's and Pizza Hut's Pizzas.

John Carmack replies to everybody.

BTW, Rys is in contact with JC since a few years ago...

Oh, and very interesting article, Rys.
It would be cool if some site decided to publish it... :p
 
If JC is eating Pizza Hut or Dominos, then I'm one very disappointed fanboi.

Round Table for teh win!
 
too much good stuff here. Now to avoid the link Maven provided so that I am not reminded how little I remember from my assembly classes. ;)
 
Rys said:
Aaaaages ago I did some digging on just where the InvSqrt function in Quake 3's source code came from. It was talked about on these very forums back in the day, that very thread part of my inspiration to brave Outlook and Google and see what was what.

Some of this has been used for quite a while. For example, there's some "nice" assembly code for a Newton-Rhapson InvSqrt in the Ti C30 reference manual (my copy's dated 1990 though it's obviously older than that) The link's an interesting read though.
 
Back
Top