Method TextureFromFloats
TextureFromFloats(float[], int, int)
Creates an UnityEngine.TextureFormat.RFloat texture from a linear array of scalar values.
public static Texture2D TextureFromFloats(float[] data, int width, int height)
Parameters
datafloat[]Source float data in row-major order.
widthintTexture width.
heightintTexture height.
Returns
- Texture2D
A clamp-wrapped bilinear-filtered floating-point texture containing the supplied values.
Exceptions
- ArgumentNullException
Thrown when
datais null.- ArgumentException
Thrown when the dimensions are invalid or do not match the data length.