Skip to main content
gamedev.net
🔒 Locked

Rendering Optimizations

Started by baneofloki 1 reply 200+ views
Original Post
baneofloki
baneofloki
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-
L_dot_N
L_dot_N
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.
baneofloki
baneofloki
Thanks! That''s alot easier than I thought.

Topic Locked

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

Sign in to reply to this topic.