DirectX Shadow Example

Started by
12 comments, last by themadme 14 years, 1 month ago
If that draw is all you comment out I don't see how it could influence things, but the documentation for DrawSubset says the following:
Quote:
An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.


Perhaps that particular code example relies on some attribute in the mesh. Have you tried using your own meshes?

To post code, use [source]source-code[/source] tags around it, as it's very hard to read now. It will look like this:
int asdf() { return 0;}
Advertisement
Thanks dude, i was wondering what the code comment was.

Well i have my own directx application and it can only render shadows if the floor is casting a shadow (using my own models).

So nothing to do with the models ... maybe something to do with draw subset ... wonder what xna does differently to directx for drawing meshes.
Oh this is just a tip but in a thread i had read http://www.gamedev.net/community/forums/topic.asp?topic_id=505893

When casting shadow maps from a directional light, instead of caluclatiing the centroid of the camera frustrum, which involves calculating the corners and etc. You could use the cameras forward direction, since that is already calculated for the camera wolrd matrix. Just use the forward direction times that by half of cameras far clip distance. Thus more cheaper i think
I jsut realised that the texture that you create for the shadow map in directx is completely inverse to xna.

I dont understand, cause in xna when you created a texure its like a blue colour for the shadows and everything else is white but in directx its white that represents the shadows and blue for everythign else.

Thats pretty weird

This topic is closed to new replies.

Advertisement