PDA

View Full Version : implementing occlusion query/hierarchial depth culling in compute shader



debonair
11-24-2015, 05:46 PM
I am looking for the tutorial or procedure for implementing occulsion queries in compute shader. What is the algorithm for this?

IonutCava
11-25-2015, 03:22 AM
Here are a couple of links that I've used and implemented successfully:
http://rastergrid.com/blog/2010/10/hierarchical-z-map-based-occlusion-culling/
http://malideveloper.arm.com/resources/sample-code/occlusion-culling-hierarchical-z/

I'm using a mixture of both to modify an indirect command buffer by culling based on an entity's bounding sphere sourced from another SSBO (that also contains all the other model data: matrices, materials, etc).
I'd recommend,at first, just flagging occluded entities and checking that flag in the main rendering pass and do something that stands out if the node should be occluded (e.g. scale the model 20 times) so you know that you are occluding correctly.