Skip to content

Depth Buffer

Claude edited this page Oct 27, 2026 · 1 revision

Depth buffer

The depth buffer is reversed and a 32-bit float: the near plane of CameraRange is written as 1 and the far plane as 0, and the closer surface wins. Blitz3D used a 16 or 24-bit buffer that is 0 at the near plane, which spends most of its precision close to the camera and makes far surfaces flicker through each other (z-fighting). With the reversed float buffer the precision is almost even over the whole range, so distant surfaces that are close together stay apart without having to push near out. This changes nothing a program can see except that z-fighting is much rarer. The depth is still not linear in the buffer itself (it is near / distance for a perspective camera, and linear for CameraProjMode 2), but the buffer is never read back by a program: ProjectedZ is the distance in front of the camera, and Graphics3D's depth argument is not used.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally