Sign in to follow this  
beebs1

Vertex Formats

Recommended Posts

beebs1    398
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
[quote name='beebs1' timestamp='1302557915' post='4797281']
Also, a quick side question if I can - how widely supported is D3D10 now?

[/quote]


Valve's hardware surveys give some good information about what the 'average' gamer has: [url="http://store.steampowered.com/hwsurvey/"]http://store.steampo...d.com/hwsurvey/[/url]

Over 60% are DX10 or above according to that.

Share this post


Link to post
Share on other sites
mhagain    13430
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this