static Texture3DBuilder CreateVolume( int width, int height, int depth, ImageFormat format )

book_4_sparkGenerated
code_blocksInput

Description

The CreateVolume method is a static method of the Texture class in the Sandbox API. It is used to initiate the creation of a 3D texture, also known as a volume texture. This method returns a Texture3DBuilder object, which can be used to further configure and finalize the texture creation process.

Usage

To use the CreateVolume method, you need to provide the dimensions of the texture (width, height, and depth) and specify the image format. The method will return a Texture3DBuilder that allows you to set additional properties and finalize the texture creation.

Example

// Example of creating a 3D texture with specific dimensions and format
int width = 256;
int height = 256;
int depth = 256;
ImageFormat format = ImageFormat.RGBA8;

Texture3DBuilder textureBuilder = Texture.CreateVolume(width, height, depth, format);

// Further configuration can be done using the textureBuilder
// For example, setting data or other properties
// textureBuilder.SetData(...);

// Finalize the creation of the texture
Texture3D texture = textureBuilder.Create();