Skip to main content
gamedev.net
🔒 Locked

SetVertexDeclaration method useless?????

Started by frayed 0 replies 400+ views
Original Post
frayed
frayed
I'm having some difficulty working out how to use multiple vertex declarations with effects files. Calling SetVertexDeclaration() seems to have no effect at all on which input parameters in the vertes shader is used. For instance i have a vertex shader with the following header: vs_main(float4 Pos: POSITION, float3 normal: NORMAL, float3 tangent: TANGENT, float3 binormal: BINORMAL) I have in Visual Studio.Net 2002 created the following vertex declaration: D3DVERTEXELEMENT9 decl[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0}, {0, 24, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0}, {0, 36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0}, D3DDECL_END()}; _device->CreateVertexDeclaration(decl, &_vertexDeclaration); , which should match the header for the vertex shader. I then call SetVertexDeclaration for this. However, if i comment out the normal, tangent and binormal nothing changes, so it seems that there is no effect in calling SetVertexDeclaration. Also I cannot figure out how to use multiple vertexdeclaration when having multiple passes. One effect i have use one kind of vertexdeclaration for the first two passes and a different for the third - how do I make the link so the right declaration is used for the right passes????

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.