pix and matrix
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
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.
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.
i try this:
create the buffer m_pSkinMatrixConstantBuffer that is ID3D10Buffer*
the struct
and update animation every frame:
and.. set the vs constant buffer:
and in the shader i have:
the data size is correct, but it's all 0 , and i set it to all 0.77777.
why?
thanks
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 );
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement