Jump to content
  • Advertisement
Sign in to follow this  

cannot use shaders with animated mesh .x

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

for some reason , i cannot display q triangle using a basic fx effect if there is a .x model rendering, ive even trying with vertex shaders and i still have the same problem , if i can get it to work then the goal is to render the joints but now i am just trying a triangle seperate the from the model , has anyone encountered this sort of problem before?

vertex shader

if(m_pAsm_VS)
{
D3DXMATRIX i,w,f,compMat,matProj;
//D3DXMatrixIdentity(&i);
D3DXMatrixRotationY(&i,z);
D3DXMatrixTranslation(&w,0.0f,0.0f,-5.0f);
f = i * w;
D3DXMatrixMultiply(&compMat,&f,&(w *matView));
D3DXMatrixMultiply(&compMat,&compMat,&matProjection);
D3DXMatrixTranspose(&compMat,&compMat);

d3ddev->SetVertexShaderConstantF(0,(float*)&compMat,4);
d3ddev->SetVertexDeclaration(m_pVertexDeclaration);
d3ddev->SetVertexShader(m_pAsm_VS);
d3ddev->SetStreamSource(0,m_pVB,0,sizeof(CUSTOMASMVERTEX));
d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
d3ddev->SetVertexShader(NULL);
}


so if i comment out this line

// render each mesh container
//draw_mesh((CUSTOM_FRAME*)TopFrame);

then the triangle above renders Edited by Anddos

Share this post


Link to post
Share on other sites
Advertisement
Use PIX debugger to figure out if the render states are being messed up by the earlier draw_mesh() calls to the point where your your DrawPrimitive for the triangle doesn't appear correctly.

You don't show the content of draw_mesh() either, does it use the effects framework? Are you specifying this flag anywhere? D3DXFX_DONOTSAVESTATE

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!