Framework 3 (Last updated: February 6, 2017)Framework 2 (Last updated: October 8, 2006)Framework (Last updated: October 8, 2006)Libraries (Last updated: September 16, 2004)Really old framework (Last updated: September 16, 2004)
Shadows that rock
Thursday, December 12, 2002 | Permalink
ShadowsThatRock.zip (450 KB)
In this demo I took the idea from the shadows that don't suck demo and made it better, hence the name. I also took the lighting from the Phong demo, and made it better. I also used a more interesting scene. Yes, that's the DM-tutorial level from UT.
For decently large scenes like this a 8bit/channel render target can have some problems with precision. Further, as we only use one channel really we ideally would want a LUMINANCE16 render target. Unfortunately, there's no extension available for rendering to luminance textures, so we'll have to stick with RGBA. Using RGBA16 means a heavy performance hit though. To solve this problem I used a RGBA8 render target but split the result up into the different components. Then I extracted it in the fragment program.
Will run on Radeon 9500/9700 only at this time. No Linux support at this time either. Note that there's a bug in current ATi drivers so you'll need to turn FSAA off for it to work.
Updated with better performance and precision. Thanks to davepermen for hints and optimizations.