Version: Unity 6 Preview (6000.0)
Language : English
Create a texture array
Sample a texture array in a shader

Create a texture array in a script

To create a texture array from a C# script, use the Texture2DArray class to initialize the texture and set pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary
data, and save the object as an asset file using AssetDatabase.CreateAsset.

Normally, texture arrays are used purely within GPU memory, but you can use Graphics.CopyTexture, Texture2DArray.GetPixels and Texture2DArray.SetPixels to transfer pixels to and from system memory.

Using texture arrays as render targets

Texture array elements may also be used as render targets. Use RenderTexture.dimension to specify in advance whether the render target is to be a 2D texture array. The depthSlice argument to Graphics.SetRenderTarget specifies which mipmap level or cube map face to render to. On platforms that support “layered rendering” (i.e. geometry shaders), you can set the depthSlice argument to –1 to set the whole texture array as a render target. You can also use a geometry shaderA program that runs on the GPU. More info
See in Glossary
to render into individual elements.

Create a texture array
Sample a texture array in a shader