"Of all the enemies to public liberty war is, perhaps, the most to be dreaded because it comprises and develops the germ of every other. War is the parent of armies; from these proceed debts and taxes known instruments for bringing the many under the domination of the few. No nation could preserve its freedom in the midst of continual warfare."
- James Madison

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 in fog
Sunday, November 10, 2002 | Permalink

Executable
Source code
ShadowsInFog.zip (406 KB)

Required:
GL_ARB_texture_env_dot3
GL_EXT_texture3D
GL_EXT_texture_edge_clamp
GL_EXT_blend_subtract
This demo shows a way to create shadows in fog. It's pretty much a hack with very little common with reality, nor is it particularily general or complete, but hey, it looks nice.

It creates the effect by rendering the shadow volume with front face culling and storing the radial distance into alpha. It then draws it with back face culling and with reverse subtract blending, which will generate distance through shadow in alpha. Then with some fancy blending I mix it together to get it into some kind of shadow.

Should run on Radeon8500/Parhelia/GF3 and up.