Archived

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

steg

Amount of triangles in brute force terrain

Recommended Posts

Hi, After the great help I got on here over brute force terrain, I was wondering what is the maximum number of triangles you can render ? I seem to be able only to do amounts of 16384 before everything messes up ? i.e. m_pDevice->DrawPrimitive(D3DPT_TRIANGLELIST,0,16384); Then if I m_pDevice->DrawPrimitive(D3DPT_TRIANGLELIST,32768,16384); crash occurs....How many triangles should be used in the call to DrawPrimitive - I take it it depends on the video card, but what is a safe number ? Also, using brute force for terrain is very slow but easy to implement (I will look at implementing ROAM algo''s later), how do I apply a texture to the scene - do I draw a texture of say size 256x256 and wrap/drape it over the whole terrain ? Kind regards, sTeVe

Share this post


Link to post
Share on other sites
Your call to Draw Primitive is incorrect. You wrote:

m_pDevice->DrawPrimitive(D3DPT_TRIANGLELIST,32768,16384);

That middle number that you set as 32768 tells directx which vertex to start at in the vertex buffer when drawing the triangles on the screen. You want to keep that at 0 so that you start drawing triangles from the first vert in your vertex buffer and increase the last number which you put as 16384 to see the number of triangles that you can render.

Actually all video cards have diffrent limits the number of triangles they can render. I think you can find out the limit of your video card by using the directx utility called the DX caps veiwer.

Hope that helps. .
~Wave


Share this post


Link to post
Share on other sites
Thanks guys,

WaveWash,

m_pDevice->DrawPrimitive(D3DPT_TRIANGLELIST,32768,16384);

I thought this would tell dx to draw another 16384 triangles from the next lot of vertices in the buffer after the ones I''ve just drawn, maybe it should read :

m_pDevice->DrawPrimitive(D3DPT_TRIANGLELIST,16384,16384); ?

Reason I use two DrawPrimitive''s is down to amount of triangles you can throw at the bus on a video card - trying to make it work for most types of video cards.

CrazedGenius : I have 256 * 256 triangles in my buffer.

Thanks for your comments and help.

sTeVe

Share this post


Link to post
Share on other sites