Friday, August 17, 2012

Mana - OpenGL Desktop (2002)

In 1995, I volunteered at a summer computer camp where the director worked on a NeXT machine.  I caught a glimpse of NeXTSTEP, and as a teen, the thing which impressed me with the machine and OS was the fact that on the desktop, a sphere continuously bounced back and forth across the screen.  That was it; a bouncing, rotating 3D sphere.  But it ran all the time, and it screamed "this machine is so powerful we can afford to waste cycles on useless, 3D background animations."  Keep in mind that 3D was just barely starting to make the rounds on consumer hardware at that point; SGI workstations were still very powerful (and expensive).

Fast-forward to 2002, when I began working as an intern for EA Canada, in Burnaby, BC.  We had dual-CPU machines, but very little software took advantage of this situation.  Even Visual Studio didn't support parallel builds yet.  (Note that much of our code was still built with 6.0.)  Because of this, it was mostly up to the OS to schedule entire programs to run in parallel.  However, though I did occasionally run two or more CPU-intensive programs at once (like, say, a data build along with a program compilation), this was definitely not a permanent state of affairs, which meant I basically had a processor sitting idle the vast majority of the time.

The NeXTSTEP background came to mind, and I figured something similar would be a nice way to harness that extra CPU power.  With a bit of idle time, I wrote a small app that creates a permanently-bottommost window and turns it into an OpenGL surface.  Ten years later, this actually still works on Windows 7 and looks even cooler with Aero, because of the window transparency effects.  However, it causes my computer's CPU fans to spin up because the cores are kept active and running at maximum frequency to handle the one busy thread (along with whatever work it dispatches to the graphics driver).

The "cool" part was actually figuring out how to make the window behave as a desktop.  Once I had that, I had to come up with something to render that wouldn't be too distracting, so I settled on a simple Sierpinsky pyramid (also apparently known as a tetrix, thank you wikipedia).  A few months later I also wrote a simple snow simulator because British Columbia is pretty green compared to Quebec, and I missed the weather from home.  It looks better at low resolutions but here goes anyway.

No comments:

Post a Comment