Texture3DBuilder WithData( System.Byte[] data, int dataLength )

book_4_sparkGenerated
code_blocksInput

Description

The WithData method of the Texture3DBuilder class allows you to specify the raw byte data for a 3D texture. This method is part of a fluent interface, enabling you to chain multiple configuration methods together to build a texture with specific properties.

Usage

To use the WithData method, you need to have an instance of Texture3DBuilder. You can then call WithData with a byte array that contains the texture data. This method returns the same Texture3DBuilder instance, allowing for method chaining.

Example

// Example of using the WithData method
byte[] textureData = LoadTextureData(); // Assume this method loads your texture data
Texture3DBuilder builder = new Texture3DBuilder();
builder.WithData(textureData)
       .WithSize(256, 256, 256) // Example size
       .WithFormat(ImageFormat.RGBA8)
       .Finish(); // Finalize and create the texture