Jump to content
  • Advertisement
Sign in to follow this  

Shader Model 4 : issues with Cascaded Shadow Maps implementation

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

I'm implementing CSM using GPU Gems 3 : Parallel-Split Shadow Maps (DX10 / Geometry Shader method) , and I have two serious issues :
1) I can't visualize my shadow maps with PIX (surface cannot be shown message) (R32_TYPELESS format)
2) I don't know what is the good way to upload a matrix array (light view / projection matrices). I do this :

(3 splits here , CSM_MAXSPLITS=8)

in the shader :

row_major matrix g_CSM_VP[CSM_MAXSPLITS];

(this is a global variable, it isn't in a tbuffer or in a cbuffer)

in the c++ program:

ID3D10EffectMatrixVariable* g_pCSMMatrices;

->[for each frame : ]
[computation of light view/proj matrices]
g_pCSMMatrices->SetMatrixArray((float *)g_CSMMatrices,0,csm.nbSplits);

I get the following warning when debugging :
D3D10: WARNING: ID3D10Device::DrawIndexedInstanced: The size of the Constant Buffer at slot 0 of the Geometry Shader unit is too small (192 bytes provided, 512 bytes, at least, expected). This is OK, as out-of-bounds reads are defined to return 0. It is also possible the developer knows the missing data will not be used anyway. This is only a problem if the developer actually intended to bind a sufficiently large Constant Buffer for what the shader expects. [ EXECUTION WARNING #351: DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL ]

I tried :

g_pCSMMatrices->SetMatrixArray((float *)g_CSMMatrices,0,CSM_MAXSPLITS);

.. but get exactly the same message (?)

And I get a black screen (my background)

Any help would be greatly greatly appreciated

Nico rolleyes.gif

Share this post

Link to post
Share on other sites
The effects framework should automatically handle figuring out how big the constant buffer should be, and creating one of the appropriate size. It shouldn't matter how much data you actually set into it. This might actually be a bug in the framework, but it's hard to know for sure.

Share this post

Link to post
Share on other sites
Hello smile.gif and thank you MJP

In fact I was about to delete my post because I made a mistake. I misunderstood the array packing rule and thought we cannot put variables bigger than 4 floats in an array unsure.gif
I just put my matrix array in an existing constant buffer and warnings vanished

Nico (previously Adaline)

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!