Texture3D
Class for handling 3D Textures, Use this to create 3D texture assets.
Read time 6 minutesLast updated 2 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: Texture
public sealed class Texture3D : Texture
Remarks
3D textures are commonly used as lookup tables by shaders, or to represent volumetric data.
Typically you'd create a 3D texture, fill it up with data (Texture3D.SetPixels or Texture3D.SetPixels32) and call Texture3D.Apply to upload the data to the GPU.
Note that this class does not support Texture3D creation with a Crunch compression TextureFormat.
Constructors
Constructor | Description |
|---|---|
| Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean,System.Boolean) | Create a new empty 3D Texture. |
| Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean,System.IntPtr) | Create a new empty 3D Texture. |
| Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.IntPtr) | Create a new empty 3D Texture. |
| Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.IntPtr,System.Boolean) | Create a new empty 3D Texture. |
Properties
Property | Description |
|---|---|
| depth | The depth of the texture (Read Only). |
| format | The format of the pixel data in the texture (Read Only). |
Methods
Method | Description |
|---|---|
| Apply | Copies changes you've made in a CPU texture to the GPU. |
| CopyPixels | Copies pixel data from another texture on the CPU. |
| GetPixel | Gets the pixel color at coordinates ( |
| GetPixelBilinear | Gets the filtered pixel color at the normalized coordinates ( |
| GetPixelData | Gets the raw data from a texture. |
| GetPixels | Gets the pixel color data for a mipmap level as Color structs. |
| GetPixels32 | Gets the pixel color data for a mipmap level as Color32 structs. |
| SetPixel | Sets the pixel color at coordinates ( |
| SetPixelData | Sets the raw data of an entire mipmap level directly in CPU memory. |
| SetPixels | Sets the pixel colors of an entire mipmap level. |
| SetPixels32 | Sets the pixel colors of an entire mipmap level. |
| UpdateExternalTexture | Updates Unity texture to use different native texture object. |
Static Methods
Method | Description |
|---|---|
| CreateExternalTexture | Creates a Unity Texture out of an externally created native texture object. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |