Skip to main content
gamedev.net
🔒 Locked

rendering patches

Started by steg 1 reply 300+ views
Original Post
steg
steg
Hi, I''ve got my LOD set up in my terrain ''engine'', each LOD has it''s own index buffer and indices buffer - is this correct ? Then I create the index buffers with the indices buffers given, thus if I have 4 indices buffers, I create 4 index buffers. Now when rendering I do the following: pDevice->SetIndices(m_pIndexBuffer); pDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,(m_xDim/m_LOD+1) * (m_zDim/m_LOD+1),0,(m_xDim/m_LOD*m_zDim/m_LOD)*2); This draws the whole terrain at a certain LOD. Ok, now I want to draw patches at differing LODs, I guess I have to have multiple calls to SetIndices and DrawIndexedPrimitive for each patch, is this so ? Seems all those calls to DrawIndexedPrimitive would be slower than doing brute force! I guess though, that once you put in culling using a quad tree, this is when things will speed up as you don''t have to check lots of quads, just patches ? Any help on the above is much appreciated. Kind regards as ever, Steve
If it isn't working, take a bath, have a think and try again...
Coincoin
Coincoin
If you use static buffers, they should be around 2 Megs (4 megs max) for optimal performance. Use writeonly flag.

If you plan on using anything that needs dynamic buffer, dont go over 1 meg buffers. Always use nooverwrite or discard lock flags. Terrain rendering should not require you to use dynamic buffers. If you need LOD, use patch geomipmaping which does not require dynamic vbs.

You are better using one big buffer than several small ones (unless they go over the limits stated above).



______________________________
Oooh, you found the horadric cube!
steg
steg
Hi,

I am using geomipmaps, I have my patches set up using an index buffer for each patch (I am using ONE big vertex buffer for ALL patches) and each patch also has its own indices buffer, question was, is this correct ? I can''t see how I can do it any other way ?

Kind regards,
Steve
If it isn't working, take a bath, have a think and try again...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.