• Advertisement

Archived

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

Rendering Optimizations

This topic is 5507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been learning how to implement octrees in Direct3D. So far all of the examples I''ve seen use the DrawPrimiveUP() function to render the tree''s leaves. I''d like to implement a better rendering function that takes better advantage of the hardware using vertex buffers. Do you think I could render the tree faster by creating a vertex buffer for each leaf and rendering each one on the fly. Or would it be better to gather all of the leaf data into one big buffer and render it all at once? I''m kind of wary of the latter, locking, copying a huge array of vertex data and unlocking a vertex buffer each frame would seem to take a lot of time. J-

Share this post


Link to post
Share on other sites
Advertisement
The DrawIndexPrimitive is the best and it is great for you use.
You build the index buffer dynamic, adding the Tri´s dynamic when a leaf is visible. So you can use the same VertexBuffer, but only a different Indexbuffer.(The Indexbuffer is not so great in the memory) Side effect you have not to build the index buffer every frame, use areas save in and cut leaves to calculate only the borders.

Share this post


Link to post
Share on other sites

  • Advertisement