Jump to content

  • Log In with Google      Sign In   
  • Create Account


Having problems converting MJP's shadow mapping sample to DX11


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 21 November 2012 - 09:35 AM

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, 24 November 2012 - 08:34 AM.


Sponsor:

#2 MJP   Moderators   -  Reputation: 10885

Like
0Likes
Like

Posted 21 November 2012 - 04:07 PM

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.

#3 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 21 November 2012 - 04:30 PM

Thanks I'm gonna have a look at it.

#4 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 24 November 2012 - 08:29 AM

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, 25 November 2012 - 07:50 AM.


#5 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 27 November 2012 - 08:46 AM

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, 27 November 2012 - 11:22 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS