Jump to content
  • Advertisement
Sign in to follow this  

Shadow Occlusion Blending

This topic is 3303 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

I've just managed to get nice looking shadows going for omni-directional lights, but I'm having problems combining the occlusion textures for more than one light. Since I'm using a deferred solution, I produce my shadow maps, and then use them to populate a shadow occlusion buffer which is then applied as post-processing effect. If I try to apply more than two lights to my occlusion buffer, only the last one is applied, so obviously I need to use alpha blending, however I have no idea what states to set to get it to work for shadows. Can anyone provide any insight? My occlusion texture is currently produced as forms (in it's simplest form):
float shadow = 1;

   shadow = 0.5f;

return shadow;

As for producing the depth maps/filling the occlusion buffer I'm doing the following (psuedocode):
foreach (light in shadowLights)


return occlusionMap;

Share this post

Link to post
Share on other sites
There's no correct way to apply shadow occlusion data once you've calculated and summed the contribution of your light sources. Anything you would do with alpha blending won't look right, and you won't be be able to apply it to the correct light source.

Either do the shadow map depth comparison in you deferred light shader and apply the occlusion factor there, or send the occlusion texture to your light shader and use that value to attenuate that light's contribution.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!