depthBuffer

fun depthBuffer(width: Int, height: Int, format: DepthFormat = DepthFormat.DEPTH24_STENCIL8, multisample: BufferMultisample): DepthBuffer(source)

Creates a depth buffer with the specified dimensions, format, and multisampling configuration. A depth buffer is used in rendering to store depth information for pixels, with optional stencil buffer support depending on the depth format.

Return

A DepthBuffer instance configured with the given parameters.

Parameters

width

The width of the depth buffer in pixels.

height

The height of the depth buffer in pixels.

format

The depth format specifying the depth and stencil configuration. Defaults to DepthFormat.DEPTH24_STENCIL8.

multisample

The multisample setup for the depth buffer, which determines if and how multisampling is applied.