Jump to content
  • Advertisement

Archived

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

Reusing VBs across multiple streams

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

Can you have a single VB as the datasource for more than one stream at once? Say I''m rendering keyframe-based models, using a vertex shader to smoothly interpolate between positions in this frame and positions in the next. I put all my texture coordinate and diffuse color data into a single vertex buffer; but what about the position data? I *could* create a VB for each frame, and then pick out the two VBs for the current render and plug them into streams... but would it be possible, instead, to just create a single VB, and SetStreamSource() it twice with different start positions?

Share this post


Link to post
Share on other sites
Advertisement
It's not setting the streamsource, its the offset in Draw(Indexed)Primitive that allows this to happen.


Kinda like this

DrawPrimitive(D3DPT_TRILIST,0,3); starts at vertic 0, and draws 3 triangles;

DrawPrimitive(D3DPT_TRILIST,6,3); starts at vertex 6, and draws 3 triangles.

EDIT: THIs code was for example.

in SetStreamSource, you can set the offset between where you draw next too.

Same with DrawIndexedPrimitive, there is a stride parm.

[edited by - RhoneRanger on April 9, 2004 9:48:35 PM]

Share this post


Link to post
Share on other sites

  • 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!