Shared Vertex and Index buffer problems
Hi,
To build my terrain, I have one large vertexbuffer and one large index buffer, which dont change (during terrain rendering at least!)
I am splitting the whole map into sections. I am building my index buffer so that each section to added in sequence - rather than running through the verts of the whole terrain, each section is indexed.
This gives me a nice ordered IB. I wanna use these sections with a quadtree to perform culling.
I can call DrawIndexedPrimitive for all the sections in one go, and see the landscape correctly.
I am trying to seperate the sections by using the INT BaseVertexIndex, UINT MinIndex of the DrawIndexedPrimitive call, so I can address each section.
This doesnt work tho!
I am doing this:
hr =_device->DrawIndexedPrimitive(
D3DPT_TRIANGLELIST,
sectorOffset,
0,
_numVertices,
0,
_numSectorPolys);
where sector offset is the start point in the index list of that section, eg 520.
Not much happening tho, I am confused by the 2nd and 3rd parameters of the DrawIP call.
Can anyone help my confusion?
Thanks!
[Edited by - sipickles on June 28, 2005 3:00:44 PM]
Quote:Can anyone help my confusion?
Maybe [oh]
It's easy enough for simple usage, but anything more than that and I end up scratching my head reading the documentation and drawing diagrams [smile]
Check out Rendering From Vertex and Index Buffers in the SDK. It's got pretty pictures and everything!
Alternatively, I (eventually) cracked how ID3DXMesh::DrawSubset() worked (using DIP) and posted it as part of an answer to this thread: ID3DXMesh AttributeTable. Might well be of interest.
hth
Jack
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement