Sign in to follow this  

Shadow Map question Again

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

Hi, I have successfully done Shadow Mapping in a xna application I finished not too long ago but now when i try to implement it into a direct application, i cant get the shadow map i want. So i looked into the 'godly' frank luna book on directx to see how he did shadow mapping which was completely different to the way i did it before. example, the xna shadow mapping i did was a version of this: http://creators.xna.com/en-GB/sample/shadowmapping1 It does the same way to build the shadow map but render the shadows some what different. The thing is that, in his example, i thought it is a waste to create a shadow map of the floor and removed that out of the shadow build part. Though when this was done, the shadows of the car and pillars disappeared? And why do you need to create the shadow map of the floor to make the shadows appear? Im not sure if anyone has explained this before and if they have, i apologise for not finding it: [Edited by - themadme on March 12, 2010 4:38:26 PM]

Share this post


Link to post
Share on other sites
If the floor is flat, and nothing can be below, then you should be able to pull it out. If you ever use a non-flat floor, you'll need to remember to put it back in because the floor can then cast shadows on itself. Double check what you did to pull the floor out of the first pass.

As for the shader code, part 2, does the book not talk about PCF? It's just filtering the shadow so it appears soft.

Share this post


Link to post
Share on other sites
Yeah, silly me. the code part just does soften the shadow - idiot of a mistake - should of known that better.

Well the floor is flat and stopping the shader to not create a shadow map should not effect the other shadows but it does which makes no sense what so ever. All i do is remove the code to not render the floor when creating the shadows, that is all.

Im guessing it has to something with the world light view projection matrix?

Has anyone attempted to do what i have done and find this weird result?

Would really much appreciate if anyone can explain this?


[Edited by - themadme on March 13, 2010 4:36:09 AM]

Share this post


Link to post
Share on other sites
I also looked at the directx shadow mapping example.

This scene doesn't contain a flat floor but a room instead (a simple box) with various objects.

When i changed the code not to create a shadow for the room, the same thing happens again, the shadow for the objects are affected.

So do you need to create a shadow of the object (wall, floor, etc.) that is behind another object for the shadow mapping to work? im guessing it has to do something with the depth of the shadow map texture.

Share this post


Link to post
Share on other sites

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