Open bryanedds opened 1 year ago
Actual occlusion checks of each individual node might be done like so - See if node is entirely contained by occluder (easy case, but probably never actually happens). Else, see if all of the node's 6 non-center eye-facing vertices are inside all of the occluder's 6 non-center eye-facing vertices.
If the individual node occlusion check are too expensive, we can always just check the parent nodes instead of the leaf nodes.
Might be good to have different types of occluders, such as faces and OBBs rather than just AABBs.
Presumably need special in-editor rendering of occluders.
Might be good to have different types of occluders, such as faces and OBBs rather than just AABBs.
However, it might be better to just have one type of occluder: an oriented quad.
This type of fundamentally hard to solve problem might be better solved with a more general approach, such as this voxelizing occluder technology - https://medium.com/@Umbra3D/introduction-to-occlusion-culling-3d6cfb195c79
Another link from Umbra which seems to have little public presence - https://unity.com/blog/engine-platform/occlusion-culling-basics-unity-4-3
I don't know how available said software is to open source entities such as ourselves.
EDIT: this fellow also has an interesting approach - https://discussions.unity.com/t/released-perfect-culling-pixel-perfect-occlusion-culling/837404/422
Okay, here's what might work for pre-entity-render culling -
We could have special occluder entities whose AABB bounds are passed into the hierarchical octree queries that checks each bounds to see if the octnode is occluded by it. We already do frustum culls, so this just expands on that process.
We could also do some processing on the occluders to extend them into each other where they combine.
Alternative to extending occluders, we could software render the occluder bounds' to create an occlusion map that octnodes can be checked for occlusion with.
The important thing is that the occlusion checks happen on the octnodes rather than each individual entity that is pulled out of the octree.
I think the big question is, how do we get the occluders themselves efficiently? Maybe they should only be and affect enclosed entities? So we can just get them with a quicker enclosed frustum query on the octree?