Jump to content
  • Advertisement
Sign in to follow this  
beebs1

Vertex Formats

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

Hiya :)

Say you have a vertex buffer consisting of a position, normal and one set of texture coordinates. When you render it using D3D9, you set the vertex declaration describing this format. Then say you have 2 shaders, the first using all these elements as input and the second using only the position. As far as my understanding goes, the vertex declaration just tells you what information is available to a shader, not that it needs to be used... right? So the second shader would run fine even though it only specifies a position as it's input.

Is this how it's usually done?

Also, a quick side question if I can - how widely supported is D3D10 now?

Many thanks for any help :)

Cheers!

Share this post


Link to post
Share on other sites
Advertisement
Yeah, the shader will run just fine. If you really wanted to you could use two streams; one containing position that's used for both shaders and one containing everything else that's used for the first shader only. You'd also need two vertex declarations of course. I'd only do that if there was measurable performance overhead from just using the same buffer and decl for both though (and a measurable performance gain from 2 streams/2 decls).

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!