Description
The CreateCube
method is a static method of the Texture
class in the Sandbox namespace. It initiates the creation of a cube texture, which is a texture that consists of six square textures arranged in a cube format. This is commonly used for environment mapping, such as skyboxes or reflection maps.
Usage
To use the CreateCube
method, you need to specify the width and height of each face of the cube texture, as well as the image format. The method returns a TextureCubeBuilder
object, which can be used to further configure and finalize the texture creation.
Parameters:
width
(int
): The width of each face of the cube texture in pixels.
height
(int
): The height of each face of the cube texture in pixels.
format
(ImageFormat
): The format of the image data for the texture.
Example
// Example of creating a cube texture
int width = 512;
int height = 512;
ImageFormat format = ImageFormat.RGBA8;
TextureCubeBuilder cubeBuilder = Texture.CreateCube(width, height, format);
// Further configuration and finalization of the cube texture can be done using cubeBuilder.