Texture3DBuilder WithDepthFormat()

book_4_sparkGenerated
code_blocksInput

Description

The WithDepthFormat method is a member of the Texture3DBuilder class in the Sandbox namespace. This method configures the Texture3DBuilder to use a depth format for the texture being built. This is particularly useful when you need to create textures that are intended to store depth information, such as depth maps used in rendering pipelines.

Usage

To use the WithDepthFormat method, you should first create an instance of Texture3DBuilder. Then, call the WithDepthFormat method on this instance to specify that the texture should use a depth format. This method can be chained with other configuration methods provided by Texture3DBuilder to fully define the texture's properties before finalizing it with the Finish method.

Example

// Example of using WithDepthFormat
Texture3DBuilder builder = new Texture3DBuilder();
builder.WithSize(256, 256, 256)
       .WithDepthFormat()
       .WithMips(4);

Texture texture = builder.Finish();
// The texture is now configured with a depth format and can be used in the application.