More than 4 UV sets in Shader Graph?

The “Tiling and Offset node” is restricted to 4 UV sets (UV0, UV1, UV2, UV3). Is there a way to use more than 4? I tried inputing a Vector2 into “Tiling and Offset” UV(2) input parameter, but wasn’t successful.

1 Like

Does Unity have a limit of 4 UVs? If so, it would not be a question of Shader Graph but of import settings.

For example, I can put a large number of vertex color layers on an object, but Unity seems to only read the first one. (The fbx exporter can export several vertex color layers). It may do the same for UV sets.

1 Like

Unity has a limit of 8 UVs, but Shader Graph only exposes the first 4. FBX importing handles all 8 just fine, though does limit itself to only importing the first two components of the UV rather than all 3 components that FBX actually holds. This is for a good reason as the vast majority of use cases don’t ever use the W of a UVW, but modelling programs and FBX don’t really have a way to denote that W isn’t being used, though it would be nice to have it as an option. Unity itself is able to hold a Vector4/float4 in each UV set, as that’s what GPUs accept. Early versions of Shader Graph didn’t expose all 4 components, only the first 2, even though the actual shader code being generated had access to all 4. Again, for most use cases this is all anyone would need, but it’s quite common to use the full float4 for various visual effects related stuff, and indeed Unity’s own particle systems can make ample use of those extra components, so enough people asked for it and it was added.

I’m sure the limit to the first 4 UVs is a similar “surely no one uses more that the first 4” oversight, and is something they could trivially include support for.

Is there a way to access further UV layers with a custom node?
Asking for a friend

Nope.

Until Unity addresses this themselves, there’s nothing you can do. Shader Graph only ever passes the first 4 UVs from the vertex shader to the fragment shader, and the input to the vertex shader only ever gets up to the first 4 UVs because the Shader Graph itself has been programmed to only get that many. Nodes can only access the data that Shader Graph itself has exposed, and without direct control over the vertex and fragment shader semantics there’s no way to get those extra UV sets.

1 Like

Ok thx alot, saved me a lot of time of pointless trial and error

It’s on the roadmap! Vote for it!

https://portal.productboard.com/8ufdwj59ehtmsvxenjumxo82/tabs/7-shader-graph

2 Likes

Nice, thx for the hint

Under consideration since 2 years probably means they don’t care about this. This is the reason why we switched to Amplify and can’t go back to Shader Graph. Such a trivial feature should be done without the need to think about it for several years.

4 Likes

“8 texture coordinates” is still “under consideration” on the roadmap for ShaderGraph. I’ve read that SkinnedMeshRenderer stores previous position for motion vector computation in texcoord4. Would be nice to be able to access it.

1 Like

2024 here :wink:

What would make this feature technically difficult for Unity?

Nothing, they just don’t care. Other features got more votes I guess.

In my problem, no way but to use vertex color as two additional uv channels thanks to my mesh is created from program not 3d software.

2025 Unity 6 still waiting?