#This is determined by the shader
1 messages Β· Page 1 of 1 (latest)
i see. so i created a lit shader graph in urp and the sample 2d node comes with only 4 uvs that is changable. while my fbx needs upto 10. and also i cant seem to find a way to expose the uv sets in such a way that it can be controlled outside the graph.
Unity 6.3 is getting 8 texture UV channels
The way to swap between them externally would be to create an Enum keyword in shader blackboard and use that as a node to pick between them
Out of curiosity what do you need whole 10 UV channels for?
so i was thinking if one can have 1 texture (using a color palette) and 1 model, just by changing uv sets i can achieve color variations. I have a 3d character whos clothes are mapped to a gradient palette texture. so if i want to change the color of the clothing i can simply switch between pre assigned color i.e.. in the UV.
That makes sense, though alternative UV channels are not the best tool for this
Your first and simplest option would be to make the gradients / gradient palettes into individual textures, and swap them per mesh as materials
my initial idea was swapping textures. but i was just wondering if this method would be feasible.
It can be done, but it's not very convenient
Especially now before 6.3 implements support for more UV channels
It's advantage versus textures is reducing texture storage and load cost, and that each UV can have an arbitrary layout
So UV islands can be anywhere and of any size, so especially if you have patterns on the texture you'd have a lot of control over how the mesh uses them
Texture load cost is typically very minimal, especially when your textures are this simple and can be small without losing any fidelity
And you can use texture arrays too to make it even less of an issue
Another thing you can do is modify UVs via a shader poperty, so you can re-use the texture for many palettes
For example each row of the texture could be gradients used by one style of item, while the columns could be alternative sets you can swap to just by offsetting the UV position per material
URP's SRP batching makes it very cheap to have many materials, especially if they only differ in their variable properties
Older batching methods weren't able to do that much
this did cross my mind. sadly when the character was textured, the character as a whole was uv'd onto 1 material. so when i try offsetting uvs to achieve the same, the uvs of the face and hands get messed up.
thanks for the input.
If you're modifying clothing UVs in shader then the face and clothes should have different material slots, but they can share UVs even though it's redundant
As long as your clothing material avoids offsetting its colors to the skin tone area of the texture, it allows them to share the texture, which could be considered an advantage
yes but my friend isnt the brightest of the bunch π
If you're swapping textures too to get different palettes, then you probably want them in different UV maps entirely
Otherwise the face UVs are always taking up texture space from the clothing and vice versa
i guess i will have to split the characte'rs uvs into skin and clothes. that way the offsetting doesnt interfere.
You can also use extra UV channels with these methods, and many of them at once to get a lot of control as long as it doesn't get confusing
UV channel swapping will have to work via unique material properties, similar to the UV offset method
The cost of extra UV channels scales with the mesh polycount, pretty much
Every UV channel is a new vector stored per each vertex, even the face vertices which won't need them
So with a lot of them your mesh can easily multiply its data size