Description
The WithData
method of the Texture3DBuilder
class allows you to specify the raw byte data for the 3D texture being constructed. This method is part of a fluent interface, enabling method chaining to configure various properties of the texture before finalizing it with the Finish
method.
Usage
To use the WithData
method, you need to provide a byte array that contains the texture data. This data should be formatted according to the texture's expected format and dimensions, which can be set using other methods in the Texture3DBuilder
class.
Example usage:
var textureBuilder = new Texture3DBuilder();
textureBuilder.WithSize(256, 256, 256)
.WithFormat(ImageFormat.RGBA8)
.WithData(myTextureData)
.Finish();
Example
var textureData = new byte[256 * 256 * 256 * 4]; // Example data array
// Fill textureData with your texture information
var textureBuilder = new Texture3DBuilder();
var texture = textureBuilder.WithSize(256, 256, 256)
.WithFormat(ImageFormat.RGBA8)
.WithData(textureData)
.Finish();
// Use the texture in your application