Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

cannot use shaders with animated mesh .x

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Anddos   Members   

588
Like
0Likes
Like

Posted 03 December 2012 - 02:35 PM

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, 03 December 2012 - 02:49 PM.

:)

#2 Steve_Segreto   Members   

2059
Like
0Likes
Like

Posted 03 December 2012 - 05:39 PM

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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.