Description
The WithDepthFormat
method is a 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 3D graphics. This method is useful when you need to create a texture cube that will be used in scenarios where depth information is required, such as shadow mapping or depth testing.
Usage
To use the WithDepthFormat
method, you must first create an instance of TextureCubeBuilder
. Then, call the WithDepthFormat
method on this instance to configure the texture cube to use a depth format. This method can be chained with other configuration methods provided by TextureCubeBuilder
to further customize the texture cube.
Example
// Create a new TextureCubeBuilder instance
TextureCubeBuilder builder = new TextureCubeBuilder();
// Configure the builder to use a depth format
builder = builder.WithDepthFormat();
// Further configuration can be done here
// ...
// Finally, build the texture
Texture texture = builder.Finish();