No Result
View All Result
Nikhil Kunche
  • Home
  • Collaborate with me
  • Home
  • Collaborate with me
No Result
View All Result
Nikhil Kunche

Fast Inverse Square Root – An ingenius Quake III Algorithm

A wonderful serenity has taken possession of my entire soul.

Nikhil Kunche by Nikhil Kunche
July 6, 2021
in Gaming, Tech
Reading Time: 3min read
146 8
0
Share on FacebookShare on Twitter

Fast inverse square root – An quake III algorithm and why it is Ingenious, how it Works

Gamer or not, everyone must have heard of the legendary Quake games. In fact, Quake II is the first game that I ever played, I was so fascinated by it that I became a perpetual gamer for life. ID Software (developer of Quake franchise) , made their engine open source in 2005. The fans of the franchise found this algorithm which happens to be a genius way to quickly calculate the inverse square root.

So why is this algorithm genius and what is the relevance?

In terms of math, we use the function:

To calculate inverse square root. When it comes to coding, it can easily be calculated by importing the math library in C Language (Quake III was actually coded in C) :

But it’s a totally different story in the Quake III Code. Below is the actual code from the game(trust me I didn’t photoshop this :P)

So what does this have to do with a game?

In order to implement physics and reflections in the game engine, it is important to compute normalized vectors. But the computing process needs to be very quick for the game to run smoothly. John Carmack developed an algorithm for this computation and it is called Fast Inverse Square Root (q_rsqrt)

Inverse square roots are essential in video game graphics particularly in 3D game engines. Path finding, lighting, reflections and many other game programming techniques require vector normalization, which involves an inverse square root operation.

Video games in 90’s

90’s nostalgia floats often on the internet. Everything that made up the past decade is being relived; Television shows, cartoons, fashion, you name it. Most importantly 90’s endowed us with epic video games. What has now evolved into a full blown multi-billion market of high tech gaming consoles saw the day of light in the 90’s.

Most popular games included super Mario, pac-man, street fighter from 90’s made our childhood more exciting. It was surely a remarkable decade. In 90’s, 3D games were in early stage, and the ability to render 3D graphics was constrained by hardware. Therefore it led to programmers to devise creative ways to get around hardware limitations.

One such creative and excellent attempt was fast inverse square root algorithm.

It was not the era of high tech gaming or high speed internet, now we see numerous stakeholders in the gaming industry; for example gaming youtube channels, you can find numerous gamers with extremely successful youtube channels with millions of subscribers.

Quake III Arena, the first person shooter video game used the fast inverse square root algorithm to accelerate graphics computation.

But the algorithm since been implemented in dedicated hardware vertex shaders using field programmable gate arrays (FGPA).

 Relevance in contemporary times

With subsequent hardware advancements, fast inverse square root algorithm is not generally applicable to modern computing, though it remains an interesting breakthrough example both historically, and for more limited machines, such as low cost embedded systems.

In conclusion, Quake III Arena, the first person shooter video game is renowned for heavy use of 3D graphics.

Tags: AlgorithmFast Inverse Square RootGamingQuake III
Previous Post

The ODIN Project – Free Knowledge for everyone

Next Post

Life Hack : Save Energy, Money using this Green Tech

Next Post

Climategate & the Global Warming Conspiracy Theory

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

No Result
View All Result

About Me

Nikhil Kunche

Nikhil Kunche

Entrepreneur | Film Maker | Author | Advocate of Climate Change

You made it this far! I see you are a man/woman of culture :D My name is Nikhil Kunche and I use this blog to rant about several things. Subscribe to receive a notification when ever I make a 900iq post -,-"

From my Flickr

  • Shadowy Figure 32
  • Shadowy Figure 33
  • Shadowy Figure 34
  • Shadowy Figure 35
  • Shadowy Figure 36
  • Shadowy Figure 37
  • Shadowy Figure 38
  • Shadowy Figure 39
  • Shadowy Figure 40

Categories

  • Climate Change (6)
  • Conspiracy Theories (7)
  • Gaming (1)
  • Green Tech (1)
  • Hair (1)
  • Life Hack (1)
  • Lifestyle (2)
  • Paranormal (4)
  • Tech (2)
Nabhivarsha.in Nabhivarsha.in Nabhivarsha.in
Nikhil Kunche

© 2021 Nikhil Kunche

Navigate Site

  • Home
  • Collaborate with me

Follow Me

No Result
View All Result
  • Home
  • Collaborate with me

© 2021 Nikhil Kunche

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In