Description
The WithMips
method is a member of the Texture3DBuilder
class in the Sandbox namespace. This method allows you to specify the number of mipmap levels for a 3D texture being constructed. Mipmaps are pre-calculated, optimized sequences of images that accompany a main texture, intended to increase rendering speed and reduce artifacts.
Usage
To use the WithMips
method, you need to have an instance of Texture3DBuilder
. Call this method on the instance, passing the desired number of mipmap levels as an integer parameter. This method returns the same Texture3DBuilder
instance, allowing for method chaining.
Example
// Create a new Texture3DBuilder instance
Texture3DBuilder builder = new Texture3DBuilder();
// Set the number of mipmap levels to 4
builder.WithMips(4);
// Continue configuring the texture
builder.WithSize(256, 256, 256)
.WithFormat(ImageFormat.RGBA8)
.Finish();