Jump to content
  • Advertisement
Sign in to follow this  
lipsryme

DX11 Having problems converting MJP's shadow mapping sample to DX11

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

Hey guys I was looking at mjp's deferred shadow mapping sample (http://mynameismjp.wordpress.com/samples-tutorials-tools/deferred-shadow-maps-sample/) and have been trying to convert this to my c++ dx11 based engine.
The issues I'm having are with the creation of the view and the orthogonal projection matrix for the directional light.

See bottom post... Edited by lipsryme

Share this post


Link to post
Share on other sites
Advertisement
I have a (non-deferred) DX11 cascaded shadow map implementation using XNAMath in a bunch of the samples that I post on my blog. You could download this one and have a look at the code as a reference.

Share this post


Link to post
Share on other sites
Well I've adopted the code in your QueryProfiling sample but I'm still having problems seeing anything in the shadow map.

Update: Okay so I've managed to get "something" on my texture. I still think there's something wrong with the viewport and the constant variables. Can someone explain what these variables do exactly ? And how I have to set them to get a correct image.


static const float ShadowDist = 1.0f;
static const float Backup = 20.0f; // -20.0f will give me an image
static const float NearClip = 1.0f;
static const float CascadeSplits[4] = { 0.125f, 0.25f, 0.5f, 1.0f };
static const float Bias = 0.005f;
Edited by lipsryme

Share this post


Link to post
Share on other sites
Update: Well now this seems to look a lot better.
http://cl.ly/image/170r1c2L0y0a/Project%202012-11-27%2016-11-13-27.jpg
What I did was invert the light direction. Not sure why MJP's light direction was already inverted there(?).
Plus these values:

const float CascadeSplits[4] = { 0.125f, 0.25f, 0.5f, 1.0f };
const float Bias = 0.005f;
const float ShadowDist = 0.4f;
const float BackupDistance = -1.0f;

The only question left now is how do I make this deferred... Edited by lipsryme

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!