Jump to content
  • Advertisement
Sign in to follow this  
Epaenetus

Reversed Shadow Map for omni-directional light

This topic is 1130 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 been trying to get shadow maps working with omni-directional lights for quite a while and I'm almost there. However, I'm currently stuck.  I have the shadow maps working and rendering, but it seems like all the shadows are in the reverse order for +x/-x and +z/-z. 

http://imgur.com/gxVg0ZA

http://imgur.com/N4utMBz

http://imgur.com/cvtvYpm

 

Has anyone else encountered this issue?

Edited by Epaenetus

Share this post


Link to post
Share on other sites
Advertisement
It's either getting reversed in your view/projection matrix that you're using for rasterizing the shadow map, or it's happening when you sample the shadow map. You can check the first case pretty easily by capturing a frame in RenderDoc or in the VS Graphics Debugger, and inspecting the resulting depth texture.

Share this post


Link to post
Share on other sites

It's either getting reversed in your view/projection matrix that you're using for rasterizing the shadow map, or it's happening when you sample the shadow map. You can check the first case pretty easily by capturing a frame in RenderDoc or in the VS Graphics Debugger, and inspecting the resulting depth texture.

Yeah, I think it has something to do with that. I'm currently using a RH view and projection matrix, but when I switched over to LH it worked fine.  

 

I found this post: http://www.gamedev.net/topic/659673-point-light-shadowmapping/

 

Following that post, I swapped my lookat vectors in the z-direction and also in my shader used to sample the shadow map, I negated my z-coordinate of my light vector.  Now the shadow mapping works for RH coordinate systems.  Are cubemaps in DirectX only able to be accessed via LH or is there a way to set it to change the access to RH.

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!