Original Post
I have a terrain map (256x256 units) which is too big to render in just one DrawPrimitive call. Some cards succeed in rendering it all at a time and some does not, though they have the same MaxPrimitiveCount in the device caps, how can that be?
Anyway, what I really want to know is how should I render all this? By calling DrawPrimitive multiple times a loose a lot of speed.
I tried with multiple DrawPrimitive calls, but less than half of the terrain is rendered, any ideas of why? See code below.
while( nRenderedPrimitives<g_nPrimitives )
{
if( nRenderedPrimitives + nPrimitivesToRender>g_nPrimitives)
{
g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, nRenderedPrimitives,
g_nPrimitives-nRenderedPrimitives);
nRenderedPrimitives += g_nPrimitives-nRenderedPrimitives;
}
else
{
g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, nRenderedPrimitives,
nPrimitivesToRender );
nRenderedPrimitives += nPrimitivesToRender;
}
}
[edited by - peter86 on November 26, 2003 4:03:45 AM]