Take a few samples of the full depth buffer to determine the closest occluder on the screen. This will provide the best available occlusions if there are many occluded virtual objects of similar size and importance.
staticSpecifiedGameObject
OptimalOcclusionDistanceMode
Sample the sub-region of the buffer that is directly over the main CG object, to determine the distance of its occluder in the world. This will provide the best quality occlusions if there is only one occluded virtual object, or if one is more visually prominent than the others
staticStatic
OptimalOcclusionDistanceMode
Stabilize the depth buffer relative to a pre-determined, unchanging depth. Not recommended if there are occluded virtual objects in the scene, but is more performant and thus optimal when occlusions are not needed.
determine the closest occluder on the screen.
This will provide the best available occlusions
if there are many occluded virtual objects of similar
size and importance.