# Occlusion culling with ARB\_occlusion\_query

**URL:** <https://community.khronos.org/t/occlusion-culling-with-arb-occlusion-query/68688>\
**Category:** OpenGL: Basic Coding\
**Created:** [October 29, 2012, 10:01am UTC](https://community.khronos.org/t/occlusion-culling-with-arb-occlusion-query/68688 "2012-10-29T10:01:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![danbartlett](https://community.khronos.org/letter_avatar_proxy/v4/letter/d/e19adc/32.png) [@danbartlett](https://community.khronos.org/u/danbartlett)\
**Post date:** [October 29, 2012, 12:41pm UTC](https://community.khronos.org/t/occlusion-culling-with-arb-occlusion-query/68688/4 "2012-10-29T12:41:16Z")

</div>

You have to disable depth writes for your bounding boxes, since you don’t want their depth value to be stored in the depth buffer - you only want the box to be tested to see if any values would be visible. Disable depth writing for your bounding box in a similar way to color writing:

```auto
glDepthMask(GL_FALSE);

```

AFAICT, it isn’t the bounding boxes that are being drawn to the color buffer, but the terrain that isn’t being drawn in that position due to your bounding box having already written a nearer depth value to the depth buffer, so the sky is visible through it.

---

_[View the full topic](https://community.khronos.org/t/occlusion-culling-with-arb-occlusion-query/68688)._
