# CubemapArray

> Class for handling Cubemap arrays.

## 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 CubemapArray : Texture
```

## Remarks

Modern graphics APIs, such as D3D10.1 and later, OpenGL 4.0 and later, and Metal on macOS support cubemap arrays, which are arrays of cubemaps with same size and format. From the shader side, they are treated as a single resource, and sampling them needs an extra coordinate that indicates which array element to sample from.

Typically cubemap arrays are useful for implementing efficient reflection probe, lighting and shadowing systems (all reflection/cookie/shadow cubemaps in a single array).

Cubemap arrays do not have an import pipeline for them, and must be created from code, either at runtime or in editor scripts. Using [Graphics.CopyTexture](/engine/6000.0/script-reference/unityengine/graphics/copytexture.md) is useful for fast copying of pixel data from regular [Cubemap](/engine/6000.0/script-reference/unityengine/cubemap.md) textures into elements of a cubemap array. From editor scripts, a common way of creating serialized cubemap array is to create it, fill with data (either via [Graphics.CopyTexture](/engine/6000.0/script-reference/unityengine/graphics/copytexture.md) from regular cubemaps, or via [CubemapArray.SetPixels](/engine/6000.0/script-reference/unityengine/cubemaparray/setpixels.md) or [CubemapArray.SetPixels32](/engine/6000.0/script-reference/unityengine/cubemaparray/setpixels32.md)) and save it as an asset via [AssetDatabase.CreateAsset](/engine/6000.0/script-reference/unityeditor/assetdatabase/createasset.md).

Note that not all platforms and GPUs support cubemap arrays. Use [SystemInfo.supportsCubemapArrayTextures](/engine/6000.0/script-reference/unityengine/systeminfo/supportscubemaparraytextures.md) to check. Also, this class does not support CubemapArray creation with a Crunch compression [TextureFormat](/engine/6000.0/script-reference/unityengine/textureformat.md).

## Constructors

| Constructor                                                                                                                                                                                                                                                                       | Description                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| [CubemapArray(System.Int32,System.Int32,UnityEngine.Experimental.Rendering.GraphicsFormat,UnityEngine.Experimental.Rendering.TextureCreationFlags)](/engine/6000.0/script-reference/unityengine/cubemaparray/ctor.md#cubemaparray\(int-int-graphicsformat-texturecreationflags\)) | Create a new cubemap array. |
| [CubemapArray(System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean)](/engine/6000.0/script-reference/unityengine/cubemaparray/ctor.md#cubemaparray\(int-int-textureformat-bool\))                                                                                   | Create a new cubemap array. |
| [CubemapArray(System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean,System.Boolean,System.Boolean)](/engine/6000.0/script-reference/unityengine/cubemaparray/ctor.md#cubemaparray\(int-int-textureformat-bool-bool-bool\))                                           | Create a new cubemap array. |
| [CubemapArray(System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.Boolean)](/engine/6000.0/script-reference/unityengine/cubemaparray/ctor.md#cubemaparray\(int-int-textureformat-int-bool\))                                                                  | Create a new cubemap array. |
| [CubemapArray(System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.Boolean,System.Boolean)](/engine/6000.0/script-reference/unityengine/cubemaparray/ctor.md#cubemaparray\(int-int-textureformat-int-bool-bool\))                                              | Create a new cubemap array. |

## Properties

| Property                                                                                 | Description                                  |
| ---------------------------------------------------------------------------------------- | -------------------------------------------- |
| [cubemapCount](/engine/6000.0/script-reference/unityengine/cubemaparray/cubemapcount.md) | Number of cubemaps in the array (Read Only). |
| [format](/engine/6000.0/script-reference/unityengine/cubemaparray/format.md)             | Texture format (Read Only).                  |

## Methods

| Method                                                                                   | Description                                                                                                                                     |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Apply](/engine/6000.0/script-reference/unityengine/cubemaparray/apply.md)               | Copies changes you've made in a CPU texture to the GPU.                                                                                         |
| [CopyPixels](/engine/6000.0/script-reference/unityengine/cubemaparray/copypixels.md)     | Copies pixel data from another texture on the CPU.                                                                                              |
| [GetPixelData](/engine/6000.0/script-reference/unityengine/cubemaparray/getpixeldata.md) | Gets the raw data from a texture.                                                                                                               |
| [GetPixels](/engine/6000.0/script-reference/unityengine/cubemaparray/getpixels.md)       | Gets the pixel color data for a mipmap level of a face of a slice as [Color](/engine/6000.0/script-reference/unityengine/color.md) structs.     |
| [GetPixels32](/engine/6000.0/script-reference/unityengine/cubemaparray/getpixels32.md)   | Gets the pixel color data for a mipmap level of a face of a slice as [Color32](/engine/6000.0/script-reference/unityengine/color32.md) structs. |
| [SetPixelData](/engine/6000.0/script-reference/unityengine/cubemaparray/setpixeldata.md) | Sets the raw data of an entire mipmap level of a face directly in CPU memory.                                                                   |
| [SetPixels](/engine/6000.0/script-reference/unityengine/cubemaparray/setpixels.md)       | Sets the pixel colors of an entire mipmap level of a face of a slice.                                                                           |
| [SetPixels32](/engine/6000.0/script-reference/unityengine/cubemaparray/setpixels32.md)   | Sets the pixel colors of an entire mipmap level of a face of a slice.                                                                           |

## 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.                    |
