Description
The D32
field is a member of the ImageFormat
enumeration in the Sandbox namespace. It represents a 32-bit depth image format, typically used for depth buffering in graphics rendering. This format is used when high precision depth information is required, such as in 3D rendering applications where accurate depth calculations are crucial.
Usage
Use the D32
format when you need to store depth information with high precision. This is particularly useful in scenarios where depth accuracy is critical, such as in shadow mapping or when rendering complex 3D scenes with multiple overlapping objects.
To use this format, you can specify it when creating a texture or a render target that requires depth information. Ensure that your graphics pipeline and hardware support 32-bit depth formats to avoid compatibility issues.
Example
// Example of using ImageFormat.D32 in a texture creation
Texture depthTexture = new Texture(
width: 1024,
height: 1024,
format: ImageFormat.D32
);
// Use the depthTexture in a render pass
RenderPass renderPass = new RenderPass();
renderPass.SetDepthTarget(depthTexture);