Jump to content
  • Advertisement
Sign in to follow this  
Maddibob

Separate Vertex Buffers

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

Can anyone point me in the direction of a tutorial or some example code which uses multiple vertex buffers (streams) for one DrawPrimitive call? Essentially, i'd like to have one vertex buffer containing some static x and z values, and a second vertex buffer containing the y values of the vertices in the first buffer. I'd then like to combine them and draw them. Anyone have any ideas on this? ...and no prizes for guessing what I'm trying to do! :-)

Share this post


Link to post
Share on other sites
Advertisement
From what i know is that you can used multiple vertex stream to store coordinate,texture,normal etc. But there is no way you can store portion of stuff like for what you are trying to do. If you want to store x,y,z you have to store everything into the same stream because that represent and entire vertex position.

Share this post


Link to post
Share on other sites
You should be able to seperate them... but your declaration (and hence VShader) will have to see a float2 and a float rather than a float3:

D3DVERTEXELEMENT9 decl[] =
{
// X/Z coordinate
{ 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
// Y coordinate
{ 1, 0, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
D3DDECL_END()
};


hth
Jack

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!