Jump to content
  • Advertisement
Sign in to follow this  
krausest

Perspective Cube Shadow Maps

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

The last resort of all PSM approaches might be a cube shadow map as described in chapter 14 of GPUGems (even available as a free PDF). Has anyone implemented that approach? I don't seem to get it right for directional lights. The light will in all cases be outside the unit cube on the infinity plane. The texture coordinate seem to sample every pixel in the back facing cube map faces (as seen from the light). How am I supposed to choose the view and projection matrix from the light onto a face of the cube map? I thought I'd choose the middle of each cube map as the point the camera looks at and find a perspective projection that stretches the cube map as big as possible but that look wrong. Any ideas? Thanks, Stefan

Share this post


Link to post
Share on other sites
Advertisement
I have not implemented PSMs myself, but NVIDIA has. Their PSM demo (which is from that GPU Gems article) is on their dev site under the SDK samples page. I guess you can try that.


-SirKnight

Share this post


Link to post
Share on other sites
Just align your camera in each of the six directions, one at a time, with a 90 degree FOV perspective projection matrix, apply the usual PSM transform and render your scene to each face of the cubemap.

PSM is a real pain. I got my implementation working for directional lights, but gave up on the point light implementation. I suggest you try LispSM instead, it's far easier to implement and gives much better shadow quality.

Share this post


Link to post
Share on other sites
Thanks for your comments.

@SirKnight: I don't think NVidias Demo uses cube shadow maps but a single shadow map. The single shadow map approach breaks down if unit cube clipping doesn't produce a smaller unit cube.

@poly-gone: Does the 90 degree choice really work for PSM cube maps? The light might be far outside the unit cube, i.e. a 90 degree fov should cause a lot of wasteage.

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!