I have this graph where I have a subgraph connected to the output.
The subgraph “Water UV” looks like this.
So based on a keyword, the output is either set to world space UVs or mesh UVs.
Then, using C# I control the keyword by its reference using material.EnableKeyword(“”).
This works fine!
The issue arises when I put the ‘Water UV’ subgraph into another subgraph. So for example like this.
Here I have a subgraph called ‘test’, which simply outputs the Water UV subgraph.
Now, changing the keyword using c# no longer has any effects.
It seems that when I nest the subgraph (that holds the keyword) into another subgraph, the keywords are no longer generated.
I checked this in the generated code.
When I don’t nest it I see
#pragma shader_feature_local WATER_UV_WORLD WATER_UV_LOCAL
as expected.
When I nest it, I see
// GraphKeywords:
Why are the keywords no longer generated when they are being nested?