Sign in to follow this  

Reversed Shadow Map for omni-directional light

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

This topic is 823 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this