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;
D3DXMATRIX g_CSMMatrices[CSM_MAXSPLITS];
.....
->[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