Method FloatsFromTexture
FloatsFromTexture(Texture2D)
Extracts the red channel of an UnityEngine.TextureFormat.RFloat texture into a float array.
public static float[] FloatsFromTexture(Texture2D tex)
Parameters
texTexture2DSource texture.
Returns
- float[]
A float array containing one scalar per pixel.
Exceptions
- ArgumentNullException
Thrown when
texis null.- ArgumentException
Thrown when the texture format is not UnityEngine.TextureFormat.RFloat.