Archived

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

cruZ

DrawPrimitive (dwCount)

Recommended Posts

Maybe a stupid question, but how do I draw scenes using DrawPrimitive or DrawPrimitiveVB that exceed 65536 vertices?

Share this post


Link to post
Share on other sites
More precisely, how would an algorithm look like if you used DrawPrimitve to draw each frame in a 3D Game? (regardless of the number of polygones in the scene)

Share this post


Link to post
Share on other sites
...With one single DrawPrimitive call you can address 65536 Verices. If you have a lot of polygones, that would not be enough. My question: How do you manage to draw such scenes.
Selkrank said I should use multiply calls of DrawPrimitive.
Is this the only solution?

How do you draw the data you get from your level file?
Lets say you have 15 million polygones in a level... after a visibility check you have 80000 polys left to draw. How would you do this by using drawprimitive


i don''t think it''s somthing like this:

pD3DDevice->BeginScene();

pD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST,
D3DFVF_VERTEX,BuildingVertices, 65536, NULL); //a building

pD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST,
D3DFVF_VERTEX,TreeVertices, 2000, NULL); //a tree
.
.
.

pD3DDevice->EndScene();


Share this post


Link to post
Share on other sites
I read somewhere, that you don''t want to package too much up into each DrawPrimitive call. The reasons were, that it took longer to send all the data to the hardware, so the hardware wouldn''t be doing anything at those times but if you spaced the calls out with a more balanced amount per call, the hardware would be kept busy, and your code would be chugging along at the same time.

of course, that might be wrong. I believe Inside Direct3D wrote that.

Personally, I have each visible object render itself to the scene, because each will have it''s own transformations anyway.

Share this post


Link to post
Share on other sites