Description
The DXT5
field is a member of the ImageFormat
enumeration in the Sandbox namespace. It represents a specific image format used for texture compression. DXT5 is a widely used compressed texture format that provides a good balance between image quality and file size, making it suitable for real-time applications such as games.
DXT5 uses a block compression technique that compresses 4x4 pixel blocks into 128 bits, with 64 bits for color data and 64 bits for alpha data. This format is particularly useful when you need to preserve alpha channel information while still benefiting from compression.
Usage
Use the DXT5
format when you need to compress textures that include an alpha channel, and you want to maintain a balance between quality and performance. This format is ideal for scenarios where transparency is important, such as in textures for foliage, glass, or other semi-transparent materials.
To apply the DXT5
format to a texture, you can specify it when creating or loading a texture in your application. Ensure that your rendering pipeline supports DXT5 compression to take full advantage of its benefits.
Example
// Example of using ImageFormat.DXT5
Texture texture = new Texture("path/to/texture.dds");
texture.Format = ImageFormat.DXT5;
// Use the texture in your game or application
Material material = new Material();
material.SetTexture("Albedo", texture);