Greeting!
I find many samples in DXSDK invoke SetVertexDeclaration() before using effect, and I also find it still works normally if i remove the SetVertexDeclaration.
So i want to know is it necessary to invoke SetVertexDelaration() before we use effect?
is it necessary to invoke SetVertexDelaration() before we use effect?
If you have manually created a primitive then you must use SetVertexDeclaration. But how ever you don't have to do that when rendering geometry data from x files. Am sure those samples are x files, aren't they?
Yes, the mesh is loaded from x file. Why doesn't the mesh loaded from x file need to SetVertexDeclaration?
Does the ID3DXMesh interface contain the vertex declaration stored in x file and set it in DrawSubset()?
Does the ID3DXMesh interface contain the vertex declaration stored in x file and set it in DrawSubset()?
There's an exact vertex declaration equivalent for every FVF. And every mesh has a FVF property. So, you don't need to manually call IDirect3DDevice9::SetVertexDeclaration(), because ID3DXMesh::DrawSubset() function calls IDirect3DDevice9::SetVertexDeclaration() before calling SetStreamSource() and SetIndices().
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement