Rasterization and Z-Buffers
 
 
 

When the system creates an instance of a GraphicsWindow, the constructor opens a window for output and connects that window to an instance of a low-level rasterizer. Since the driver has complete control over the window's palette (if one exists), each GraphicsWindow within 3ds Max must be connected to the same driver.

The physical window consists of two parts: an image buffer (containing the colored pixels, as they appear on the screen) and a Z buffer. The Z buffer is used to record depth at each pixel as geometric primitives are rasterized.

Most drivers control two image buffers. One is displayed on the screen, and the other is used to rasterize geometric primitives. When rasterization of a complete frame is done, the off-screen buffer is transferred onto the display screen in a single bit-block transfer operation.

The z-value at a particular location can be accessed using the method GraphicsWindow::getDepthValue(). The entire viewport image of the graphics window can be retrieved using the method GraphicsWindow::getDIB().