Jump to content
  • Advertisement
Sign in to follow this  
chadmv

[MDX] VertexDeclaration and .x files

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

Hello there, I'm a bit rusty. I'm rendering a .x file with a simple diffuse lighting shader. The model is just a sphere with a red material. Everything renders fine with and without setting the Device.VertexDeclaration. So I guess my question is: What's up with that? I thought VertexDeclarations were needed in order to specify whats in the pipeline but it seems to be doing just fine without the declaration.

Share this post


Link to post
Share on other sites
Advertisement
2 things that might shed some light on what's going on:

(1) See if you are getting any debug output about it (warnings/info, ect)

(2) Use IDirect3DDevice9::GetVertexDeclaration() to see if there is a declaration already set, and if so, in what format it is. Note that you need to have a non-pure device to do this (easy to disable/enable either way).

Share this post


Link to post
Share on other sites
There's no vertex declaration before mesh.DrawSubset but the declaration right after DrawSubset contains Position, Normal, Color, TextureCoordinate, Tangent, and Binormal so it looks like mesh.DrawSubset automatically sets the declaration to its own declaration. Is this normal? Thanks.

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!