Jump to content
  • Advertisement
Sign in to follow this  
Altemia

Octree render order

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

My question:

How would I go about ordering my octrees so they render away from the camera from front to back. Its for Occlusion Culling.

Should I do something along the lines of taking the camera position in reference to a nodes center and using that to decide whether to draw nodes starting with front or right or whatever and then use the view direction to decide whether the camera is looking at objects from the inside out.


This was just a thought and I'd appreciate any suggestions which I could look into that would be better. :)

Share this post


Link to post
Share on other sites
Advertisement
this article describes how to traverse the octree for a raycast, you could use the eye-point + viewdirection as ray, but rejecting octree nodes based on the frustum (not on the ray intersection), then you should in theory end up with a good order for occlusion culling.




http://chiranjivi.tripod.com/octrav.html

a simple alternative would be to calculate the 8 center points of the ocetree nodes and calculate the distance to the near plane (basically just a dot4).

Share this post


Link to post
Share on other sites
I usually break scene-traversal and rendering into two different steps.
e.g.array<renderable> renderList;
octree<renderable> scene;

for each visible cell in scene:
for each renderable in cell:
renderList.add( renderable )

sortByDepth( renderList )

draw( renderList )

Share this post


Link to post
Share on other sites

I usually break scene-traversal and rendering into two different steps.
e.g.array<renderable> renderList;
octree<renderable> scene;

for each visible cell in scene:
for each renderable in cell:
renderList.add( renderable )

sortByDepth( renderList )

draw( renderList )


that's good for rendering, but for occlusion culling you'd miss the opportunity to cull high level nodes, not processing anything below it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!