Jump to content
  • Advertisement
Sign in to follow this  
giugio

pix and matrix

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

Hy. I'm try to ultimate my skinned animation project. My problem is to test the constant buffer matrix in pix. I can't find any mode for show the matrix values! Is possible in pix to show the constant buffers values or debug it in any mode , for ex to create in the shader code a matrix(float4x4) and assign it to a value in the constant buffers , but i can't see the values of this matrix in pix. Why? thanks

Share this post


Link to post
Share on other sites
Advertisement
Thanks.
I find how display the costant buffers in pix .
I have createt a buffer in similarly at the vertex and index buffer, but change some constant,(sorry but i don't have the code behind).
I see that there are two paramenter for set the constant buffer , slot and count , what are?
But I see that my costant buffers(in pix) are different from the data to send.
how i send my data to the gpu' s constant buffers?
Can you explain the better way for send constant buffers to the gpu and how retrieve they from the shader?
Thanks.

Share this post


Link to post
Share on other sites
i try this:

create the buffer m_pSkinMatrixConstantBuffer that is ID3D10Buffer*

D3D10_BUFFER_DESC cbDesc;
cbDesc.ByteWidth = sizeof( cSkinMatrix );
cbDesc.Usage = D3D10_USAGE_DYNAMIC;
cbDesc.BindFlags = D3D10_BIND_CONSTANT_BUFFER;
cbDesc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
cbDesc.MiscFlags = 0;
hr = m_pDevice->CreateBuffer( &cbDesc, NULL, &m_pSkinMatrixConstantBuffer ) ;


the struct

struct cSkinMatrix
{
D3DXVECTOR4 pmatrices[3];
};



and update animation every frame:

void CMaterialSkin::UpdateAnimation(long nTime)
{
cSkinMatrix* mx ;

HRESULT hr = m_pSkinMatrixConstantBuffer->Map( D3D10_MAP_WRITE_DISCARD, NULL, ( void** )&mx );
//m_pSkeleton->updateAnimation(nTime, mx->pmatrices);
mx->pmatrices[0]= D3DXVECTOR4(0.7777777f, 0.7777777f, 0.7777777f, 0.7777777f);
mx->pmatrices[1]= D3DXVECTOR4(0.7777777f, 0.7777777f, 0.7777777f, 0.7777777f);
mx->pmatrices[2]= D3DXVECTOR4(0.7777777f, 0.7777777f, 0.7777777f, 0.7777777f);
mx->pmatrices[3]= D3DXVECTOR4(0.7777777f, 0.7777777f, 0.7777777f, 0.7777777f);

m_pSkinMatrixConstantBuffer->Unmap();


/*delete[] mx->pmatrices;*/

}



and.. set the vs constant buffer:

ID3D10Buffer* pBuffers[2] = { m_pSkinMatrixConstantBuffer };
m_pDevice->VSSetConstantBuffers( 0, 1, pBuffers );

and in the shader i have:



cbuffer skinConstant
{
float4 skinnedMatricesVS20[4];

}




the data size is correct, but it's all 0 , and i set it to all 0.77777.
why?
thanks

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!