- Home /
Question by
ananion · Dec 02, 2018 at 05:42 PM ·
shaderscginitialization2d array
How do I initialise a TEX2DARRAY in shader with RenderTextures from C# script
I am having trouble passing my Render Textures from C# script to a 2DArray in my cg shader for post processing effects.
While I have managed to initialise the Array with one Render Texture, I have not managed to get multiple textures into the array. I did that like this:
Shader.SetGlobalTexture("_TextureArray", renderTexArr[0]);
I could then use the following commands to use the render texture in the shader:
UNITY_DECLARE_TEX2DARRAY(_TextureArray);
UNITY_SAMPLE_TEX2DARRAY(_TextureArray, float3(i.uv, index));
But how do I assign all elements of the array?
Comment