Jump to content

  • Log In with Google      Sign In   
  • Create Account

is it necessary to invoke SetVertexDelaration() before we use effect?


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
4 replies to this topic

#1   Members   

96
Like
0Likes
Like

Posted 13 March 2012 - 06:50 AM

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?

#2   Members   

275
Like
1Likes
Like

Posted 13 March 2012 - 07:12 AM

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?

#3   Members   

96
Like
0Likes
Like

Posted 13 March 2012 - 07:41 AM

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()?

#4   Members   

336
Like
1Likes
Like

Posted 13 March 2012 - 09:11 AM

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().
There's no "hard", and "the impossible" takes just a little time.

#5   Members   

96
Like
0Likes
Like

Posted 13 March 2012 - 07:10 PM

Get it, guys!




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.