Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Sylvain "Sly" Vignaud, posted on October 26, 2002

Image Description, by Sylvain "Sly" Vignaud

Hello coders, Remember my last iotd (Quake+bump)? I added soft shadows on top of it and here is the result.

This algo for soft shadows is:
  • fast: 30fps displaying a Quake III levels on a Duron 800MHz, GeForce 2MX
  • crappy
  • doesn't look that good
  • Basically, while creating the shadow volumes with the stencil buffer, I also compute a shadow attenuation based on the distance between the occluder and the pixel, and I store it in the Alpha value of the pixel color. That means that every polygon that is displayed in the Stencil buffer is also displayed in the alphas of the color buffer.

    Then when I am displaying a big dark quad on top of the screen to darken the shadow area, I activate blending based on the alpha values stored in the color buffer, and here is the trick!

    More screenshots at:

    Image of the Day Gallery


    Archive Notice: This content is archived, and commenting is no longer active. It is here for reference purposes. This content was added on an older version of flipcode, before the site closed in 2005.
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.