Shader Graph: Choosing Texture2DArray Index by uv.z (218675)

Hi,

I try to achieve the following:
Given a Texture2DArray with different textures I want to draw a specific one. As I’ve done it without shader graph I set

uv0[index] = new Vector3(uvPosition.x, uvPosition.y, textureArrayIndex);

and use uv.xy as real uv coordinates and uv.z as my index for choosing the Texture out of Texture2DArray.
Somehow I do not get it to work with shader graph.

I use this layout:

It somehow does not pick the correct index but uses some other (constant) index.
I have a functioning workaround using another uv channel, but I suppose it should work as I’ve done above, right?
Here is my work-around using uv2 only for picking the correct index:

            uvs[index] = new Vector2(uvPosition.x, uvPosition.y);
            uvs2[index] = new Vector2(textureArrayIndex,0);

With a graph like this:

So, am I doing it wrong or is there a bug?

1 Answer

1

The reason was found:
Vector 3 and 4 is not yet implemented for UVs in shader graph