What is the point of multiple vertex buffers?
Started by mrheisenberg, Sep 14 2012 09:47 AM
5 replies to this topic
Ad:
#3 Members - Reputation: 332
Posted 14 September 2012 - 02:28 PM
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.
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?
#4 Members - Reputation: 511
Posted 14 September 2012 - 02:51 PM
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?
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.
my last project: Roa. working on something new now.
#5 Moderators - Reputation: 5415
Posted 14 September 2012 - 04:05 PM
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.
#6 GDNet+ - Reputation: 2367
Posted 14 September 2012 - 05:09 PM
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.
Jason Zink :: DirectX MVP
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article






