Description
The WithMultiSample2X
method configures the TextureBuilder
to use 2x multisampling. Multisampling is a technique used to improve the quality of rendered images by reducing aliasing, which is the visual stair-stepping effect that can occur along the edges of objects. By using 2x multisampling, each pixel is sampled twice, which can result in smoother edges and a more visually appealing texture.
Usage
To use the WithMultiSample2X
method, call it on an instance of TextureBuilder
when you want to enable 2x multisampling for the texture you are building. This method is part of a fluent interface, allowing you to chain multiple configuration methods together to customize the texture's properties before finalizing it with a creation method.
Example
// Example of using WithMultiSample2X in a TextureBuilder
TextureBuilder builder = new TextureBuilder();
Texture texture = builder
.WithSize(256, 256) // Set the size of the texture
.WithMultiSample2X() // Enable 2x multisampling
.Create("MyTexture", false, data, data.Length); // Create the texture with specified data