Sign in to follow this  
age_of_lion

If device not support D3DFMT_R32F how to do shadow map

Recommended Posts

age_of_lion    133
I had deeply learnt through the MS 2006 SDK shadow map sample. Although In my game project, I used it for skin mesh real time shadow map, yes , it works very well. If the device is very old that render target format not support D3DFMT_R32F, the application cannot run. the following codes: //g_pShadowTex render target texture HRESULT hr=pd3dDevice->CreateTexture( Shadow_SIZE, Shadow_SIZE, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R32F, D3DPOOL_DEFAULT, &g_pShadowTex, NULL ); hr will be E_FAIL and crashed. How to do shadow map on these very old display card PC that device not support D3DFMT_R32F? Who can help me. thanks a lot of.

Share this post


Link to post
Share on other sites
Evil Steve    2017
According to the card caps XLS spreadsheet, cards prior to the Radeon 9600 or GeForce FX 5900 don't support D3DFMT_R32F.
I don't know the shadow mapping algorithm myself, but surely if the card doesn't support it, you should just ditch shadow mapping completly? There's some things that older cards just won't be able to do, and if they can be done using other methods, they'll be extremely slow.

Nitpick: If something fails, your app should never crash - you should handle the error correctly. The crashing is not to do with the function failing, its to do with you incorrectly handling it.

Share this post


Link to post
Share on other sites
MJP    19754
Well it's not as if D3DFMT_32F is the only format you can use for shadow mapping...D3DFMT_16F will have precision problems but certainly isn't unusable. Older Nvidia GPU's also supported hardware shadow maps through D24S8 surfaces.

Also, why are you using the 2006 SDK?

Share this post


Link to post
Share on other sites

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