Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

robert_s

How to make stencil shadows soft (ie. soft edges)

This topic is 5448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
If there was an easy way to get soft stencil shadows, don''t you think Doom3 would be using them?

Stencil shadows are fundamentally a boolean in/out test, theres no good clean way to extend that to proper soft shadows. Theres an ugly hack of juddering light sources and re-rendering multiple times, but thats neither big or clever.

The current best method for soft shadows is shadow maps, but that needs quite up to date hardware (and isn''t accurate, its just a reasonably good looking approximation).

Share this post


Link to post
Share on other sites
You can make stencil shadows soft by rendering the on/off mask into a render target, then blurring it based on how far away the pixel is. Blurring with depth approximates perspective on the soft shadow boundary. You do get bleeding on object edges, but you can fix that by using the trick of ignoring blur samples that have a large depth delta. This is also used in one of the ATI DoF samples.

Here are some screenshots of this technique (doesn''t ignore blur samples though):

http://www.mhalpin.34sp.com/images.html

(Top 4 screenshots)

HTH

Matt Halpin

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!