Description
The WithMips
method is a part of the Texture2DBuilder
class in the Sandbox namespace. This method configures the texture to use mipmaps, which 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, call it on an instance of Texture2DBuilder
to enable mipmaps for the texture being built. This method is chainable, allowing you to combine it with other configuration methods provided by Texture2DBuilder
.
Example
// Example of using WithMips in a Texture2DBuilder
Texture2DBuilder builder = new Texture2DBuilder();
Texture texture = builder
.WithSize(256, 256) // Set the size of the texture
.WithFormat(ImageFormat.RGBA8) // Set the format of the texture
.WithMips() // Enable mipmaps
.Finish(); // Finalize and create the texture