Occlusion Query is a technical term that is extremely important in rendering and optimizing game graphics (technical art). A technology that uses the GPU's hardware functions to count how many pixels are actually output on the screen when the object being drawn is hidden by a nearby obstruction (such as a wall), and feeds back the hidden determination to the CPU.

An example in the real world: Before opening the door of a room, we have the robot scout how many people can be seen inside (query) through the gap in the door, and if no one can be seen (0 pixels), we don't turn on the lights in the room (drawing process), which is a total saving.

A dummy box is thrown into the GPU's depth test, which can determine the most accurate ``eyes are there'' instead of guessing ``whether it's hidden behind a wall'' using only the CPU, and returns a result (query result) that ``not a single pixel was visible on the screen.'' This is a thorough automatic occlusion judgment that skips 100% of the drawing of real heavy assets.

Occlusion Query concept infographic diagram

Figure: Infographic that clearly illustrates the basic processing flow and mechanism of Occlusion Query in Japanese notation

Detailed mechanism and operating principle

A simple box (bounce volume) is drawn as a dummy on the GPU side, and when an occlusion query is thrown and the number of pixels drawn = 0, the CPU side completely skips issuing the draw call of the real heavy model.