Saturday, May 24, 2008

Squack3D


Alright, hence starts my first Technical project for the vacations. For those interested, my internship is now officially "Work-from-home" status, so I need not go to office everyday, but just pop in now and then for reviews. :-)

This project I'm embarking on is basically just a learning-experience type thing, don't really think it has much value as such. Anyhow, the project is called "Squack3D" (for lack of a better name), and is a very very stripped-down elementary 3D engine, that tries to offer the simplest 3D functionality for games that could be incredibly large to incredibly small. But the point is that the graphic needs of those games will have to be really basic, with no fancy effects etc. The second objective is to have the engine run at super-lightning speed, so that its really good at whatever limited functionality it gives. The third objective is to incorporate Procedural development techniques right into the basic fabric of the 3D engine which will reduce a lot of effort on the part of the game developers to develop stochastic algorithms etc for basic things.

Let me summarize the objectives:
  1. A highly stripped-down engine focusing on very basic graphics and primitives giving games and applications with low-fi graphic expectations a very small and suitable 3D engine
  2. Super-fast rendering and processing
  3. Inherent support for Procedural generation of content
  4. Ready-made templates for basic applications and games
  5. Free! In all the senses.
Shashank
PS: The scene in the picture is NOT from my engine however! :-) Its from a software called Terragen.
PPS: Your browser isn't rendering my blog incorrectly, I have indeed stripped all styling and graphics from my blog for simplicity and elegance with this new design. :-)

Monday, May 19, 2008

This is how I look when I'm forcibly woken up...


Dee Snider, from "Twisted Sister".

An awesome heavy-metal band of the 80s, never-mind their make-up. ;-)

(That's a guy in the picture, BTW. That's Dee Snider).

Saturday, May 17, 2008

The Lore of the Inverse Square Root function


This one is for all the 3D geeks!

I had posted some useful optimizations for Graphic programmers earlier, and one of the optimizations I had suggested was one I saw in the Quake 3 source code, which performs the inverse square root, i.e 1 / sqrt(x). In 3D Graphics, the question of who came up with the 'magic' constant
0x5f3759df continues to be a question that 3D geeks still seek to answer! Most attribute it to the legendary programmer John Carmack, the man behind the Quake, Doom and all id Software Game Engines. However there are several other people attributed to it, and John himself refused to take claim for the creation of the constant in the mail:

-----Original Message-----
From: John Carmack
Sent: 26 April 2004 19:51
Subject: Re: Origin of fast approximated inverse square root

At 06:38 PM 4/26/2004 +0100, you wrote:

>Hi John,
>
>There's a discussion on Beyond3D.com's forums about who the author of
>the following is:
>
>float InvSqrt (float x){
> float xhalf = 0.5f*x;
> int i = *(int*)&x;
> i = 0x5f3759df - (i>>1);
> x = *(float*)&i;
> x = x*(1.5f - xhalf*x*x);
> return x;
>}
>
>Is that something we can attribute to you? Analysis shows it to be
>extremely clever in its method and supposedly from the Q3 source.
>Most people say it's your work, a few say it's Michael Abrash's. Do
>you know who's responsible, possibly with a history of sorts?

Not me, and I don't think it is Michael. Terje Matheson perhaps?

John Carmack

Why this is so important could be understood by the fact that Chris Lomont, a professor at Purdue took up the task of deriving that constant by mathematical means for the initial approximation of the Newton Raphson method (that the magic code uses), and his 'mathematically and theoretically' brilliant approximation constant turned out to perform WORSE than the constant found in the Quake III source code. So the question that arises is how John Carmack, or the author who originally wrote the code managed to figure out the magic approximation. That could be pretty useful I think for designing other fast mathematical functions.

So this article on Beyond3D.com does a great job of tracing down the original author, or atleast a major contributor, after a great deal of digging around. Check it out:
Origin of Quake III's Fast Inverse Sqrt()

Thursday, May 15, 2008

The Creativity-Killer : Office life


Don't get me wrong. Its not because I'm really unhappy at the fact that my vacations are getting ruined as I have to "WORK" in the office 10 hrs a day everyday (read) but truly a realisation that I came about due to this effort.

The "office life" destroys your creativity, forcing you to do continually work piecemeal on mostly dumb projects that you know will never revolutionize anyone's life, but basically does the routine that people need. Yes, this kind of routine work has to be done by someone, but if you're like me, you will not be the one to get stuck in this zombie culture of waking up in the morning, slaving for 10 hours, and then returning towards late evening, too tired to do anything but slouch on a chair drinking tea and writing about how dumb you feel. One simply doesn't have the time or energy to think about ANYTHING else after returning from office. All one seeks to do is to relax and sleep soon. Gotta sleep early.. office in the morning remember? In short, even if you are good, the routine office life will bring you down to its levels of mundaneness and dumbness and make you feel generally really stupid and out of touch.

This is the typical routine every office worker follows, and my statements are meant for those select few who desire to break away from the system and be different. If you are fine with serving people's routine needs, that is perfectly genuine too. Do not mistake me. I am talking about those people who can be intensely creative, know that they can do better things for people, have confidence in themselves that they can create things that will make better and revolutionize the life of others as well as theirs. The first casualty when you get stuck in the drill of conventional life is your sense of Independent thinking.

A matter of bread and butter, some would say. True. You've gotta do what you've gotta do. However, when there is an opportunity, grab it. Risks are meant to be taken, some big and some small. When you have the chance to some radically better stuff, do it. I have been in IEEE Students' Chapter for the past two years, and was the Secretary at last count. But I felt that it was time to move on and do other things, even though I appeared to have a very good chance at the top job. However, it was a risk nevertheless, leaving IEEE to get back the time to do bigger things, develop new ideas that could potentially be the next big things. I feel I can do it. So risk I must. Risk the general "social standing", risk the chance of not having any work to channel one's energies. This is an example of a small risk, almost negligible. But the basic point does not change. If you want to be different, don't get stuck in any kind of routine. One must follow for a while, and move on to other things to remain fresh and dynamic.

Tuesday, May 13, 2008

The coming ages of immersive gaming?


Just found this interesting looking article about the possibilities offered by immersive large-display systems. Check this out:

Wall-sized, multi-touch 'Missile Command' -- every gamer's fantasy

To quote a few catchy phrases:

"A gentleman named Steve Mason has created a large-scale version of the game that can be played by hand using multiple contact points. The result? Extreme awesomeness." Lol! ;-)

There's a flash video on that page that demonstrates players playing the game live.

I've posted this here, as this has gotten me thinking again about the trends that games will follow in the coming few years. Yes, this particular wall-display system noted above is not really "immersive", but in all essence, I would get completely immersed in such a game! Wouldn't you? ;-) Don't get me wrong, I'm not calling the above game display system "immersive"!

Having been involved in a lot of personal game-development projects, I find it extremely fascinating to note that we are indeed moving closer and closer to the age of true Virtual Reality, where the technology blurs the barriers between what we really believe to be "real", and what we don't. I for one would be the first to question what we indeed are, returning to the age old question of "why are we here?", and "HOW are we here and conscious about it?". Anyhow, the concept of Virtual Reality really raises a lot of interesting questions- technical, business-related, ethical, psychological and philosophical.

More on this soon. Promise.

9 hr 45 minutes a day. 6 days a week. 33 days.

That's the duration of my summer internship. There goes my vacation, can see it fleeing away while I sit in the office.

Have a confidentiality agreement with them, don't want to talk about them anyway. My poor vacation...

Monday, May 12, 2008

Yet another 'Airport Blues' saga


This time around, hanging around Bangalore's Great Airport, I discovered some harsh truths of life. Life is like the Cafe Coffee Day Espresso that you get at the Bangalore Airport. You do not ever get what you wanted, its hideously expensive, it has no sugar, is black and really awful. Stirring it up makes no difference really, ultimately you end up with the same old stuff and its better to drink it up in one quick gulp than one prolonged struggle and bitter taste. And it always tasted better in the good ol' days.

I can say without doubt that THAT was simply the worst coffee I ever had in my life, and saying that would be a gross understatement. I was waiting to pick up my mom, and due to a series of (un)fortunate events ended up reaching the Airport really quickly, and an hour and half early. Bangalore Airport is seriously not the best place to hang out, and they take great pains to maintain and further that reputation. No chairs or waiting lounges at the Arrivals gate. Just one Cafe Coffee Day outlet with smirking faces serving you bad coffee. So I managed to find a seat in the Departures section, and then was sprayed all over with insecticide. The stupid bugger chose to make his grand entry right at the moment I sat down, and sprayed those fumigated kerosene-like smelling fumes all over me, and the people all around me too. Luckily its meant only for mosquitoes and small insects, not animals.

Oh, and I am alive, kicking and have finally returned back to this blog.
Auf Weidersehen!

PS: I speak German now.

PPS: I simply cannot understand how people manage to drink Black Coffee! My theory is that people find themselves awakened by sipping Black Coffee because each sip is so horrible and bitter that it shocks them awake. That's how I stayed awake for 1.5 hours at the airport, and just managed to finish half of my coffee (which was originally half a cup anyway). Gruesome really.