Archived

This topic is now archived and is closed to further replies.

Multiple Parallel Buffers...?

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

Hay Guys, I''m trying to learn about vertex buffers, and so far it''s all been plain sailing, but now i''m trying to do something a little bit different, and i''m not getting the result i expect. I want to do this: Fill a buffer with vertices. Fill a buffer with colors for each vertex. Fill an index buffer. Draw them using DrawIndexPrimitives() So far i''ve got the buffers filled, but when i go to draw them the colours dont show...? Let''s assume that i have the buffers filled correctly. What should i be doing now? Currently i''m doing something like this; ... SetStreamSource(0, positionBuffer, 0); SetStreamSource(1, colorBuffer, 0); Indices = indexBuffer; ... DrawIndexedPrimitives(...) For render states i''ve turned lighting off, flat shading on and per vertex colors on. So why am i still getting a black mesh! I''m sorry i cant post the code as it''s on another machine thanks in advance

Share this post


Link to post
Share on other sites
You can''t use multiple streams with the fixed vertex function pipeline. The way to use multiple streams is to define what elements are in what streams in a vertex shader type declaration. The vertex shader isn''t any different if you want to use multiple streams, but you need to set the vertex shader declaration correctly, or DirectX has no clue what elements are where!

Chris Pergrossi
My Realm | "Good Morning, Dave"

Share this post


Link to post
Share on other sites