Sign in to follow this  
mrheisenberg

What is the point of multiple vertex buffers?

Recommended Posts

You can build your verrtex elements from different components that come from different VBs. For example, you could put {position, normal, tex2d} in one vertex buffer and {tangent, extra_tex2d} in another vertex buffer.

Share this post


Link to post
Share on other sites
[quote name='Quat' timestamp='1347651108' post='4980147']
You can build your verrtex elements from different components that come from different VBs. For example, you could put {position, normal, tex2d} in one vertex buffer and {tangent, extra_tex2d} in another vertex buffer.
[/quote]

but what benefit would that have?Won't it do the same thing as as ingle one,but with extra little overhead for creating/setting the second buffer?

Share this post


Link to post
Share on other sites
[quote name='mrheisenberg' timestamp='1347654509' post='4980167']
but what benefit would that have?Won't it do the same thing as as ingle one,but with extra little overhead for creating/setting the second buffer?
[/quote]

If you want to only update certain attributes of the buffer, you can save some bandwidth by splitting the data. It's often used for instancing, where one buffer contains the actual model and another buffer holds the models' world matrices.

Share this post


Link to post
Share on other sites
There's all kinds of reasons. One popular reason is to split up your vertex data based on the passes used to render a mesh. So for instance you might store position in one vertex buffer and everything else in another vertex buffer, and then use just the position buffer when rendering shadows. lwm already mentioned that it can be useful if a portion of your vertex data is dynamic, therefore it makes sense to keep the dynamic data in its own buffer since typically you have to update the entire contents of a dynamic buffer. Another reason might be that it's just easier for certain cases to work with multiple vertex buffers, for instance if all of your source vertex data came in as separate channels that aren't interleaved.

Share this post


Link to post
Share on other sites
So to summarize what MJP said, the reason is to reduce the bandwidth needed for feeding vertices into the pipeline. If you know a particular rendering pass will only use positions (i.e. a depth only pass) then it doesn't make sense to pass in a full featured vertex. Instead, you can selectively choose the parts of your vertex to pass in, with a negligible penalty for re-assembling the vertices at runtime.

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