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

robot_2Generated
code_blocksInput

Description

The CreateVolume method is a static method of the Texture class in the Sandbox namespace. 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.

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 image data.

Example

// Example of creating a 3D texture with specified 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 of the texture can be done using the textureBuilder
// For example, setting data or finalizing the texture creation
textureBuilder.SetData(data);
Texture3D texture = textureBuilder.Create();