Simple Question about Vertex Arrays

Started by
1 comment, last by illadel4life 19 years, 8 months ago
I have multiple objects each with their own array of Vertices that need to be drawn to the screen. How should I approuch this, a) Use one vertex buffer and just compact the vertices together even though its NOT the same object, and use a little trickery witht he index buffer? <----The more I think about it, the more this makes sense...... b)Create a Vertex buffer for each object, BUT that might get crazy, becuase lets say I have 5 objects of 1 type, and 1 object of another and 3 objects more left, that would be 10 Vertex Buffers. Can I assign each buffer to a different "source" for the D3D device? or is there a max? Well once I figure this out and my other problem I can start loading my models into my FG - Sonic 2-2(1/2)D w000t... THanks in Advance
Advertisement
Hi,

both is doable. But I would only use a) if it was for static objects.

Your b) statement is not quite right. It's very well possible to use the same vertex buffer if you have 5 objects of type 1. You simply have to decouple your vertex data from your objects and instead let your objects reference to the vertex data. Like this all your type 1 object would refer to the same vertex data.

Metron
----------------------------------------http://www.sidema.be----------------------------------------
So when its time to "render" the objects just re-user the vertex buffer but draw them in a differnt place? to simulate different Objects.....uh yes I think I'm seeing this.

Well IS there a Maxium Vertex Source? like only 8 vertex buffers can be used per-scene? I never thought about it, I might just google that question, but does anybody know on the top of their head?

This topic is closed to new replies.

Advertisement