Archived

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

MAS

Yann's (H)OM

Recommended Posts

MAS    122
Hi All, I’ve got a working version of occlusion map culling. I use a single level 0 of z values to cull the scene against. It works well enough, but I’m not at all happy about testing each object against the map in a linear fashion. I thought I could use the same hierarchical approach as view frustum culling. I prune sub-trees at nodes whose bounding boxes are culled against the map. This approach does not work however as objects in the scene disappear and reappear (in a popping fashion) due to the fact that some polygons in the leaf nodes of the pruned sub-tree are in the occlusion map. I’m experimenting with the idea of extracting the occludee bounding boxes from an STL priority_queue in order from largest box/nearest z to smallest box/farthest z. The idea is that as I test each box against the level 0 map, I can dismiss all the remaining boxes in the queue when I encounter the first box extracted from the queue that is deemed occluded when tested against the map. I’m not in at all convinced that this is workable. Surely someone has explored the idea of not testing each occludee individually. I’m sure that hierarchical view frustum culling ideas can be extended to culling hierarchically against a single map of z values. I’ll grant you that someone reading this might have come across a solution to this but is reluctant to part with it! Still, I’ll pose the question and hope for some inspiration. Perhaps the only way to take advantage of the culling hierarchically is to impose the hierarchy on the occlusion map (in the same way that Ned Greene does for his hierarchical z buffer). Hope you can help! Martin.

Share this post


Link to post
Share on other sites
technobot    238
quote:
Original post by MAS
I thought I could use the same hierarchical approach as view frustum culling. I prune sub-trees at nodes whose bounding boxes are culled against the map. This approach does not work however as objects in the scene disappear and reappear (in a popping fashion) due to the fact that some polygons in the leaf nodes of the pruned sub-tree are in the occlusion map.

This should work, as long as you test the whole area of the bounding box, and not just the corners, and only reject the node if it is completely occluded. When a node is completely occluded, then all child nodes are also occluded, and can therefore be safely discarded, even if they are themsleves occluders (such occluders won't contribute anything to the occlusion map anyway). If this isn't working in your implementation, chances are you have a bug somewhere.
quote:
Perhaps the only way to take advantage of the culling hierarchically is to impose the hierarchy on the occlusion map (in the same way that Ned Greene does for his hierarchical z buffer).

This may be a good idea regardless of how you test your objects (linearly or hierarchally), since this reduces the cost of each individual test. The downside is that it takes more time to construct the occlusion map hierarchy. Run some tests to see if the tradeoff is good in your case.

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"



We come in peace... surrender or die!

[edited by - technobot on May 26, 2004 3:34:22 AM]

Share this post


Link to post
Share on other sites
Karg    133
Have you tried just rendering all of the occluders? In the ideal case, all occluders would be visible and therefore need to be drawn. Working on that assumption, just draw all of the occluders and hope that the overdraw isn''t too much. Picking too many occluders (which would raise the chance of having more overdraw) would also slow down the occlusion map rendering. And heirarchical testing of the geometry is really the way to go for complex scenes.

karg

Share this post


Link to post
Share on other sites