Jump to content
  • Advertisement

Archived

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

poly-gone

Octrees with VertexBuffers?

This topic is 5540 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 wanna know how to render my maps using an Octree. After building an Octree and dividing it, how do I render the polygons/vertices in the Octree. Can I use a vertex buffer for each node and store that node''s vertices in a VB and render that when the node is visible? If yes, how do I know which textures I need to assign to what vertices in the node? How are Octrees generally used to render maps? Thanks

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by poly-gone
Can I use a vertex buffer for each node and store that node''s vertices in a VB and render that when the node is visible?

If yes, how do I know which textures I need to assign to what vertices in the node? How are Octrees generally used to render maps?



to your first question, yes but i imagine by VB you mean static VB. in that case your octree would have to be static as well. A better choice would Dynamic VB''s... there was an article not to long ago dealing with dynamic VB''s that was quite good.

to your second question. im not too clear, do you mean multiple textures, texture coordinates, ???

third. Octrees are very general, how you use them is totally dependent on your application. but i guess the general use is split, if visible draw, do it again.

Share this post


Link to post
Share on other sites
Yes, I mean multiple textures. What I mean is, if I read in a map or some sort like a .3ds file, it would have many textures. How do I determine what group of vertices in a node have one particular texture?

Thanks for the first and third answers.

Share this post


Link to post
Share on other sites
I''m going to implement Oct-trees in my game, here''s how I''m planning on doing it...

Create the oct-tree (duh)
Each oct-tree node will have a ref to the objects that are in the boundaries for that node - hence the ones that need rendering.
Each model I have created a single vertex buffer - not one per render instance.
Then when rendering; query the tree to find what needs rendering
setstreamsource to the VB for that model
Transform it''s position, rotation and scale into a worldspace matrix
Set the matrix
Render
Repeat for next object...

Share this post


Link to post
Share on other sites
Hey, that's a good idea to. Instead of a polygon soup, you store object indices. That way, you won't need to find the texture for each polygon/vertex. Thanks.

[edited by - poly-gone on August 19, 2003 10:27:52 AM]

Share this post


Link to post
Share on other sites
YOu''re more than welcome.

To be honest, it''s that sorta stuff I''d wanna know when just starting.

I just created my first particle engine. It looks gorgeous.

Share this post


Link to post
Share on other sites
Hey downgraded - that''s how i do my octrees as well My only worry about it is that: say you have a large mesh that spans many octants...when you come to querying your octree, it will traverse down all the octants only to find that it has already renderered that mesh (after the 1st traversal).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!