Hardware Accelerated Global Illumination

Global Illumination is a rendering technique that attempts to simulate the way light bounces off objects.

Compare this with raytracing, where objects absorb 100% of the light hitting them – only objects in direct line of sight of a light source will be lit. Everything else is pitch black.

Global illumination, then, gives much softer and more realistic shadows. As an added bonus, we also get color bleeding effects – place a red ball next to a white wall, and you can see some of the red bouncing off of the ball onto the wall.

Hardware Accelerated Global Illumination is a (perhaps misguided) attempt to move much of the work done in GI rendering onto the graphics card. I’d been pondering this for a while, and was a little disappointed to find that it wasn’t a new idea. Nevermind, I decided to try it out anyway. Elias’ site offers a better introduction to this technique than I could give, and it’s pretty similar to the way I’m implementing it.

I have no idea how well this will run. I’m using C# & DirectX9, on a 1.4G Athlon & GF4. On the one hand, in theory nothing too complex is happening here – it’s just a lot of calls to render a scene to a texture. And my test scene is a few thousand polys – low by todays standards. However, I’ll need to sample the scene from a few thousand different points every time the global illumination updates…

I’m hoping I’ll be able to move through the scene in real time, with the lighting updating every second or so. We’ll see.

Where are we now?

I can create simple rooms, assign colors & brightness to each surface, and save them to a file. I can render the view looking out from each surface.

Next up is rendering the view from each surface into a texture – I was having trouble persuading this to work, and ended up running through this handy tutorial.

Converting that tutorial to DirectX9 was unpleasant in places – some of the interfaces are totally changed, and the Microsoft documentation is still rather sparse. The DirectX newsgroups have proved handy here.

But then I got distracted by programmable pipelines, and then moved to OS X. This is on hold until I rewrite my code on my Mac, or until I switch back to Windows…

· 2004-10-10 ·

Commenting is closed for this article.