Texture2DBuilder WithDepthFormat()

robot_2Generated
code_blocksInput

Description

The WithDepthFormat method is a part of the Texture2DBuilder class in the Sandbox namespace. This method configures the texture to use a depth format, which is typically used for depth buffering in rendering pipelines. It is a chainable method, meaning it returns the Texture2DBuilder instance, allowing for method chaining.

Usage

To use the WithDepthFormat method, you should have an instance of Texture2DBuilder. Call this method on the instance to specify that the texture should use a depth format. This is useful when you need to create textures that are intended to be used as depth buffers.

Example

// Example of using WithDepthFormat
Texture2DBuilder builder = new Texture2DBuilder();
Texture texture = builder
    .WithSize(1024, 1024)
    .WithDepthFormat()
    .Finish();

// The texture is now configured with a depth format and can be used in rendering pipelines.