Using Texture2DArray as RenderTarget and passing data to fragment shader

I’d like to render multiple views into an array of 2D textures, then pass this array into a fragment shader for processing.

Imagine a stack of differing 2D viewpoints of the 3D scene, where on the 0th texture we render the left-most view and the last element is the right-most view of the scene.

I would like to pass this array to a fragment shader for processing.

Currently I’m just using one render texture and tiling the views, which works but has limitations in dimension sizes.

I came across a post that said 5.4 has hardware 2D texture array support, but there is no documentation on using the class Texture2DArray. I’ve tried but I’m not sure how to access each 2D texture element from the array to write to it, or read from it in the shader.

For render textures, you don’t use Texture2DArray,

Still, use RenderTexture. Set RenderTexture.dimension to be TextureDimension.Tex2DArray,
and the desired volumeDepth(array length), after creating the RenderTexture object.

Then, you can use Graphics.SetRenderTarget with the depthSlice indicating which element of the array you want to render to.

How to read it is much more simpler, just use a float3 with z as the array index.