TextureCubeBuilder WithDepthFormat()

robot_2Generated
code_blocksInput

Description

The WithDepthFormat method is part of the TextureCubeBuilder class in the Sandbox namespace. This method configures the texture cube to use a depth format, which is typically used for depth buffering in rendering pipelines. By calling this method, you can ensure that the texture cube is set up to handle depth data, which is crucial for certain rendering techniques such as shadow mapping or depth testing.

Usage

To use the WithDepthFormat method, you need to have an instance of TextureCubeBuilder. Call this method on the instance to configure the texture cube with a depth format. This method is chainable, meaning you can call other configuration methods on the same instance in a fluent style.

Example

// Create a new TextureCubeBuilder instance
TextureCubeBuilder builder = new TextureCubeBuilder();

// Configure the builder to use a depth format
builder = builder.WithDepthFormat();

// Continue configuring the builder as needed
builder = builder.WithSize(512, 512)
                 .WithFormat(ImageFormat.RGBA8)
                 .WithMips(1);

// Finish building the texture
Texture texture = builder.Finish();