Framework 4 (Last updated: October 25, 2019)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 don't suck
Saturday, September 21, 2002 | Permalink
Executable
Source code
shadowsthatdontsuck.zip (594 KB)
Required:GL_ATI_fragment_shader or GL_NV_register_combiners
GL_ARB_texture_cube_map
GL_EXT_texture3D
GL_EXT_texture_edge_clamp
WGL_ARB_render_texture/GLX_ATI_render_texture
Recommended:GL_ARB_texture_compression
GL_EXT_texture_compression_s3tcWhen I was at my job interview with nVidia we spoke a little about what kind of project I'd do. As shadows are one of the hardest problems in 3d graphics and most shadowing implementations has some kind of serious drawbacks I got the suggestion to work on "shadows that don't suck" for a project. Even though I didn't get the job I decided to try finding a good shadow algorithm myself anyway. However, after being held back by a driver bug I left the project for the time being and only recently got back into the project again.
What I have done is a shadow mapping implementation that works for point lights. The idea is quite simple, instead of rendering the depth into a texture as with normal shadow mapping I render the radial distance into a cubemap. The radial distance is easy to look up in a 3d texture. A check with the stored distance and the currently calculated distance is done in a fragment shader and can easily interact with perpixel lighting. The final result is a very realistic shadow effect.
One of my better demos IMO.
This is also the first demo based on my new and much improved framework.
Thanks to MZ for the help with the register combiner code.
It will run on Radeon 8500/GF3 and up.