# Texture3D

> Class for handling 3D Textures, Use this to create 3D texture assets.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Inherits from:** [Texture](/engine/6000.0/script-reference/unityengine/texture.md)

```csharp
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](/engine/6000.0/script-reference/unityengine/texture3d/setpixels.md) or [Texture3D.SetPixels32](/engine/6000.0/script-reference/unityengine/texture3d/setpixels32.md)) and call [Texture3D.Apply](/engine/6000.0/script-reference/unityengine/texture3d/apply.md) to upload the data to the GPU.

Note that this class does not support Texture3D creation with a Crunch compression [TextureFormat](/engine/6000.0/script-reference/unityengine/textureformat.md).

## Constructors

| Constructor                                                                                                                                                                                                                                   | Description                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| [Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean,System.Boolean)](/engine/6000.0/script-reference/unityengine/texture3d/ctor.md#texture3d\(int-int-int-textureformat-bool-bool\))                   | Create a new empty 3D Texture. |
| [Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean,System.IntPtr)](/engine/6000.0/script-reference/unityengine/texture3d/ctor.md#texture3d\(int-int-int-textureformat-bool-intptr\))                  | Create a new empty 3D Texture. |
| [Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.IntPtr)](/engine/6000.0/script-reference/unityengine/texture3d/ctor.md#texture3d\(int-int-int-textureformat-int-intptr\))                     | Create a new empty 3D Texture. |
| [Texture3D(System.Int32,System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.IntPtr,System.Boolean)](/engine/6000.0/script-reference/unityengine/texture3d/ctor.md#texture3d\(int-int-int-textureformat-int-intptr-bool\)) | Create a new empty 3D Texture. |

## Properties

| Property                                                                  | Description                                              |
| ------------------------------------------------------------------------- | -------------------------------------------------------- |
| [depth](/engine/6000.0/script-reference/unityengine/texture3d/depth.md)   | The depth of the texture (Read Only).                    |
| [format](/engine/6000.0/script-reference/unityengine/texture3d/format.md) | The format of the pixel data in the texture (Read Only). |

## Methods

| Method                                                                                                  | Description                                                                                                                |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [Apply](/engine/6000.0/script-reference/unityengine/texture3d/apply.md)                                 | Copies changes you've made in a CPU texture to the GPU.                                                                    |
| [CopyPixels](/engine/6000.0/script-reference/unityengine/texture3d/copypixels.md)                       | Copies pixel data from another texture on the CPU.                                                                         |
| [GetPixel](/engine/6000.0/script-reference/unityengine/texture3d/getpixel.md)                           | Gets the pixel color at coordinates (`x`, `y`, `z`).                                                                       |
| [GetPixelBilinear](/engine/6000.0/script-reference/unityengine/texture3d/getpixelbilinear.md)           | Gets the filtered pixel color at the normalized coordinates (`u`, `v`, `w`).                                               |
| [GetPixelData](/engine/6000.0/script-reference/unityengine/texture3d/getpixeldata.md)                   | Gets the raw data from a texture.                                                                                          |
| [GetPixels](/engine/6000.0/script-reference/unityengine/texture3d/getpixels.md)                         | Gets the pixel color data for a mipmap level as [Color](/engine/6000.0/script-reference/unityengine/color.md) structs.     |
| [GetPixels32](/engine/6000.0/script-reference/unityengine/texture3d/getpixels32.md)                     | Gets the pixel color data for a mipmap level as [Color32](/engine/6000.0/script-reference/unityengine/color32.md) structs. |
| [SetPixel](/engine/6000.0/script-reference/unityengine/texture3d/setpixel.md)                           | Sets the pixel color at coordinates (`x`, `y`, `z`).                                                                       |
| [SetPixelData](/engine/6000.0/script-reference/unityengine/texture3d/setpixeldata.md)                   | Sets the raw data of an entire mipmap level directly in CPU memory.                                                        |
| [SetPixels](/engine/6000.0/script-reference/unityengine/texture3d/setpixels.md)                         | Sets the pixel colors of an entire mipmap level.                                                                           |
| [SetPixels32](/engine/6000.0/script-reference/unityengine/texture3d/setpixels32.md)                     | Sets the pixel colors of an entire mipmap level.                                                                           |
| [UpdateExternalTexture](/engine/6000.0/script-reference/unityengine/texture3d/updateexternaltexture.md) | Updates Unity texture to use different native texture object.                                                              |

## Static Methods

| Method                                                                                                  | Description                                                                 |
| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [CreateExternalTexture](/engine/6000.0/script-reference/unityengine/texture3d/createexternaltexture.md) | Creates a Unity Texture out of an externally created native texture object. |

## Inheritance

**Inherited Members:**

* [Texture.GenerateAllMips()](/engine/6000.0/script-reference/unityengine/texture/generateallmips.md)
* [Texture.SetGlobalAnisotropicFilteringLimits(int, int)](/engine/6000.0/script-reference/unityengine/texture/setglobalanisotropicfilteringlimits.md)
* [Texture.GetNativeTexturePtr()](/engine/6000.0/script-reference/unityengine/texture/getnativetextureptr.md)
* [Texture.IncrementUpdateCount()](/engine/6000.0/script-reference/unityengine/texture/incrementupdatecount.md)
* [Texture.SetStreamingTextureMaterialDebugProperties()](/engine/6000.0/script-reference/unityengine/texture/setstreamingtexturematerialdebugproperties.md#setstreamingtexturematerialdebugproperties\(\))
* [Texture.SetStreamingTextureMaterialDebugProperties(int)](/engine/6000.0/script-reference/unityengine/texture/setstreamingtexturematerialdebugproperties.md#setstreamingtexturematerialdebugproperties\(int\))
* [Texture.mipmapCount](/engine/6000.0/script-reference/unityengine/texture/mipmapcount.md)
* [Texture.graphicsFormat](/engine/6000.0/script-reference/unityengine/texture/graphicsformat.md)
* [Texture.width](/engine/6000.0/script-reference/unityengine/texture/width.md)
* [Texture.height](/engine/6000.0/script-reference/unityengine/texture/height.md)
* [Texture.dimension](/engine/6000.0/script-reference/unityengine/texture/dimension.md)
* [Texture.isReadable](/engine/6000.0/script-reference/unityengine/texture/isreadable.md)
* [Texture.wrapMode](/engine/6000.0/script-reference/unityengine/texture/wrapmode.md)
* [Texture.wrapModeU](/engine/6000.0/script-reference/unityengine/texture/wrapmodeu.md)
* [Texture.wrapModeV](/engine/6000.0/script-reference/unityengine/texture/wrapmodev.md)
* [Texture.wrapModeW](/engine/6000.0/script-reference/unityengine/texture/wrapmodew.md)
* [Texture.filterMode](/engine/6000.0/script-reference/unityengine/texture/filtermode.md)
* [Texture.anisoLevel](/engine/6000.0/script-reference/unityengine/texture/anisolevel.md)
* [Texture.mipMapBias](/engine/6000.0/script-reference/unityengine/texture/mipmapbias.md)
* [Texture.updateCount](/engine/6000.0/script-reference/unityengine/texture/updatecount.md)
* [Texture.isDataSRGB](/engine/6000.0/script-reference/unityengine/texture/isdatasrgb.md)
* [Texture.imageContentsHash](/engine/6000.0/script-reference/unityengine/texture/imagecontentshash.md)
* [Texture.totalTextureMemory](/engine/6000.0/script-reference/unityengine/texture/totaltexturememory.md)
* [Texture.desiredTextureMemory](/engine/6000.0/script-reference/unityengine/texture/desiredtexturememory.md)
* [Texture.targetTextureMemory](/engine/6000.0/script-reference/unityengine/texture/targettexturememory.md)
* [Texture.currentTextureMemory](/engine/6000.0/script-reference/unityengine/texture/currenttexturememory.md)
* [Texture.nonStreamingTextureMemory](/engine/6000.0/script-reference/unityengine/texture/nonstreamingtexturememory.md)
* [Texture.streamingMipmapUploadCount](/engine/6000.0/script-reference/unityengine/texture/streamingmipmapuploadcount.md)
* [Texture.streamingRendererCount](/engine/6000.0/script-reference/unityengine/texture/streamingrenderercount.md)
* [Texture.streamingTextureCount](/engine/6000.0/script-reference/unityengine/texture/streamingtexturecount.md)
* [Texture.nonStreamingTextureCount](/engine/6000.0/script-reference/unityengine/texture/nonstreamingtexturecount.md)
* [Texture.streamingTexturePendingLoadCount](/engine/6000.0/script-reference/unityengine/texture/streamingtexturependingloadcount.md)
* [Texture.streamingTextureLoadingCount](/engine/6000.0/script-reference/unityengine/texture/streamingtextureloadingcount.md)
* [Texture.streamingTextureForceLoadAll](/engine/6000.0/script-reference/unityengine/texture/streamingtextureforceloadall.md)
* [Texture.streamingTextureDiscardUnusedMips](/engine/6000.0/script-reference/unityengine/texture/streamingtexturediscardunusedmips.md)
* [Texture.allowThreadedTextureCreation](/engine/6000.0/script-reference/unityengine/texture/allowthreadedtexturecreation.md)
* [Texture.graphicsTexture](/engine/6000.0/script-reference/unityengine/texture/graphicstexture.md)
* [Object.GetInstanceID()](/engine/6000.0/script-reference/unityengine/object/getinstanceid.md)
* [Object.GetHashCode()](/engine/6000.0/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/6000.0/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/6000.0/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectssortmode\))
* [Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive-findobjectssortmode\))
* [Object.DontDestroyOnLoad(Object)](/engine/6000.0/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindObjectsByType\<T>(FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectssortmode\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive-findobjectssortmode\))
* [Object.FindFirstObjectByType\<T>()](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>()](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindFirstObjectByType\<T>(FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindFirstObjectByType(Type)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindFirstObjectByType(Type, FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytype\(type-findobjectsinactive\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/6000.0/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/6000.0/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/6000.0/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/6000.0/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/6000.0/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/6000.0/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
