SetPixels32
Sets the pixel colors of an entire mipmap level.
Read time 3 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
SetPixels32(Color32[], int)
Sets the pixel colors of an entire mipmap level.
public void SetPixels32(Color32[] colors, int miplevel)
Parameters
The array of pixel colours to use. This is a 3D texture flattened to a 1D array.
The mipmap level to write to. The range is through the texture's Texture.mipmapCount. The default value is .
colors00Remarks
This method sets pixel data for the texture in CPU memory. Texture.isReadable must be , and you must call Texture3D.Apply after to upload the changed pixels to the GPU.
trueSetPixels32colorsA single call to is usually faster than multiple calls to Texture3D.SetPixel, especially for large textures.
SetPixels32SetPixels32You can use with the following texture formats:
SetPixel32- Alpha8
- ARGB32
- ARGB4444
- BGRA32
- R16
- R16_SIGNED
- R8
- R8_SIGNED
- RFloat
- RG16
- RG16_SIGNED
- RG32
- RG32_SIGNED
- RGB24
- RGB24_SIGNED
- RGB48
- RGB48_SIGNED
- RGB565
- RGB9e5Float
- RGBA32
- RGBA32_SIGNED
- RGBA4444
- RGBA64
- RGBA64_SIGNED
- RGBAFloat
- RGBAHalf
- RGFloat
- RGHalf
- RHalf
For all other formats, fails. Unity throws an exception when fails.
SetPixels32SetPixels32Additional Resources: Texture3D.SetPixels, Texture3D.SetPixelData, Texture3D.GetPixels32, Texture3D.GetPixels, Texture3D.Apply, mipmapCount.
SetPixels32(Color32[])
Sets the pixel colors of an entire mipmap level.
public void SetPixels32(Color32[] colors)
Parameters
The array of pixel colours to use. This is a 3D texture flattened to a 1D array.
Remarks
This method sets pixel data for the texture in CPU memory. Texture.isReadable must be , and you must call Texture3D.Apply after to upload the changed pixels to the GPU.
trueSetPixels32colorsA single call to is usually faster than multiple calls to Texture3D.SetPixel, especially for large textures.
SetPixels32SetPixels32You can use with the following texture formats:
SetPixel32- Alpha8
- ARGB32
- ARGB4444
- BGRA32
- R16
- R16_SIGNED
- R8
- R8_SIGNED
- RFloat
- RG16
- RG16_SIGNED
- RG32
- RG32_SIGNED
- RGB24
- RGB24_SIGNED
- RGB48
- RGB48_SIGNED
- RGB565
- RGB9e5Float
- RGBA32
- RGBA32_SIGNED
- RGBA4444
- RGBA64
- RGBA64_SIGNED
- RGBAFloat
- RGBAHalf
- RGFloat
- RGHalf
- RHalf
For all other formats, fails. Unity throws an exception when fails.
SetPixels32SetPixels32Additional Resources: Texture3D.SetPixels, Texture3D.SetPixelData, Texture3D.GetPixels32, Texture3D.GetPixels, Texture3D.Apply, mipmapCount.