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 specify the dimensions of the 3D texture (width, height, and depth) and the desired image format. The method will return a Texture3DBuilder that allows you to set additional properties and finalize the texture.

Parameters:

  • width (int): The width of the 3D texture in pixels.
  • height (int): The height of the 3D texture in pixels.
  • depth (int): The depth of the 3D texture in pixels.
  • format (ImageFormat): The format of the texture, which determines how the image data is stored.

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 finalizing the texture creation
// textureBuilder.SetData(...);
// Texture texture = textureBuilder.Create();