Multiple UV Sets

Hi,

I got some questions about importing.

1.Is it possible to import meshes with three or more UV sets into Unity3D?

2.Is it possible to use vertex colors as a set of UV? If the answer is yes, how?

Thanks.

I’m assuming you mean UV maps, if so:

  1. yes.

  2. what? I don’t quite understand your second question.

Unity only directly supports two UV sets. It’s possible you might be able to hack around that in a shader by appropriating unused data as UV data instead.

–Eric

I read the reference and found the Mesh got only two sets of uv variables: uv and uv2. So I just wonder if I can use colors as the third set of uv.

If you make a function in your 3d App that writes your third set of UV coordinates into the vertex color, and then make a shader that uses vertex colors as UV’s, then sure… :slight_smile:
You could even pass two uv-sets per color: rgba:uvuv, which would give you a total of 4 supported uv-set, instead of two as is. Great idea, never thought of that…

I Have found a valid reason to use over 50 uv sets. Would this be possible? Could a custom shader be writen for this if it is not possible now? I realize this may sound rediculus but its not.

What’s the valid reason? :wink:

I have a deck of cards and instead of having to call on 53 different cards that call on a couple textures, or 53 different textures for one card, I can use one card and one texture and swap between UV coordinance. This would be more efficient I believe. Option one I have 53 different models that make up the deck of cards and the backside of the card. These all call on 3 different textures. So to play cards the script will have to call on geometry to appear and disappear. The second option Calls for One model and the script to swap textures so instead of there being 3 larger textures that house all the cards there are 53 small textures. The third option is to have one model and one large texture that houses’ all the face cards and the back of the card and simply have 53 UV sets all set on the texture space corresponding to the texture space of the card that UV space should represent. This way the script can simply change between UV sets. Its experimental but could prove to be more efficient.

You don’t need 52 UV sets. You need a single texture sheet with all 52 cards on it and then use UV offset to switch to the appropriate section of the texture atlas.

Thanks for the feedback. I was thinking it would be easier to organize if there were multple UV sets but I guesse there is no reason the UV coordinence cant be named in the script to be sure that a 3 shows up when its supost to and not a 2.

for that use you would just place all cards on one texture. If you then know much each card is on say 512 texture, you have everything you need to offset the uvs to match the current card. No need for different uv sets