ImageFormat D24X8_SHADOW

book_4_sparkGenerated
code_blocksInput

Description

The D24X8_SHADOW field is a member of the ImageFormat enumeration in the Sandbox namespace. This specific image format is used for depth textures with a 24-bit depth component and an 8-bit stencil component, optimized for shadow mapping. It is typically used in rendering pipelines where shadow precision is crucial, and the stencil buffer is not required.

Usage

Use ImageFormat.D24X8_SHADOW when you need to create or work with depth textures that are specifically optimized for shadow mapping. This format is particularly useful in scenarios where high precision depth information is needed without the use of a stencil buffer.

Example

// Example of using D24X8_SHADOW in a rendering context
Texture depthTexture = new Texture(1024, 1024, ImageFormat.D24X8_SHADOW);

// Set the texture as a depth target for a render pass
RenderPass renderPass = new RenderPass();
renderPass.SetDepthTarget(depthTexture);

// Use the render pass in a scene
Scene scene = new Scene();
scene.AddRenderPass(renderPass);