Jump to content
  • Advertisement

Archived

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

JinJo

Octree (making sure a face isn't in two nodes)

This topic is 5239 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

Hi, I''m just implementing an Octree structure for to speed up rendering etc. I pass in all static faces in my scene into the octree and it splits them up and stores them in the child nodes,standard stuff. But since a face is made up of a number of vertices that means the face could lie in two or more nodes of the octree, which isn''t good obviously. So how would I go about fixing this? I thought that I should just split the face up into smaller faces by removing and adding new vertices that all lie in the same node. Just I''m not entirely sure how to do this, can anyone help?

Share this post


Link to post
Share on other sites
Advertisement
Alternatively you could just allow the face index to be stored in both nodes and then keep a bit vector of indices that have been drawn in a render. When rendering a face, check this bit vector to ensure it has not yet been drawn. If not, set the bit vector to true at this index and render the face.

Share this post


Link to post
Share on other sites
I suppose I could do that, but wouldnt splitting the face up into a few more vertices not be faster to render instead of doing an if check at each face.

Also the scene compiles the data from faces but when rendering it''s just one big bunch of vertices that gets sent to the GPU so your method wouldn''t work with my system.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I''m currently designing my little 3D engine and have the same problem. I''d be interested in a solution or a hint, too.

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!