I have a one mesh object made in 3DMax that uses 2 UVs, each UV is assigned to a different part of the object. In 3dMax everything is fine. However, when I import the FBX object into Unity and I assign each UV to its place, I get this:
and if I swap the UV Channels, I get this:
My question is… how can I get Unity to show both UVs?
What exactly is the problem with what I am doing?
I’ve updated the image with the mesh renderer open.
As for the materials:
I just imported the model.
The texture are separate tga files.
Of course when I imported the model it had two materials without the textures. I just added the missing textures from the asset folder to the existing materials that the model required.
If you look at the picture above, you’ll notice it’s already set to 2 and I already have 2 materials assigned to it. To me the problem seems that Unity sees just one UV map while the other it sees just as some… other texture but not as UV.
Are you finding that the second slot is not changing anything? If you change the material in the second slot, does it change the look of the model at all?
It makes me feel like this model is being exported with one material rather than 2, but I’m guessing.
Why is it necessary for you to use the second UV channel? Why not just use the primary UV channel and 2 materials? All Unity built-in shaders bind the main texture to the first UV set. You could change this in the shaders but it seems unnecessary unless you’re trying to do something unique. And by the looks of the model you’re simply trying to use 2 materials on a single mesh.
We’re building a game for mobile phones, and we try to limit the texture size to 1024. In order not to lose detail we made 2 textures for this mesh, which, if needed can be shrunken later.
It may look that we’re trying to use 2 materials on the same mesh, but this is not the case. The second material is simply there because of the second UV channel. The problems seems to be with the second UV channel which is not active at the moment…or something like that.
We have also tried with other formats like DAE and OBJ and we faced the same problem.
Whoops! My bad. I assumed by UV, you meant sets of assigned UVs per texture, not UV channels.
aNTeNNa trEE is correct in his question: “Why two UV channels?” You can keep your texture atlases to 1024^2 by using two materials, each with their own texture. Do you have a particular need for two UV channels? Over simply using two materials on one channel?
Alright, can you be more explicit and show me what you mean ?
How can I assign a second material to the same UV channel, in Unity?
Thing is, we have two different UV sets, each for a different set of polygons. Each UV set is set as a different material. One UV Channel is for one UV set and its polygons, the second UV channel is for the other UV set and its polygons. The second UV channel is not represented correctly.
I only have a few secs. In (an over simplified manner) Blender it’s simply creating two materials in the materials pane and when you unwrap/assign the faces to a material, use the material containing the appropriate texture. Save Export. You will have two material slots in one uv set on import to Unity.
You might want to pop onto third party tools in the forum and ask for help specific to your 3d package.
I’m not a Max user, but I know in Blender you can use different materials on the same set of UVs. Splitting the mesh would solve the problem, and probably won’t cause (too many?) issues. I won’t bore you with the details in Blender, as I’m sure the details are different, but as all the premier packages share similar functionality, I’m sure it can be done in Max.
I did a quick google of “assigning uvs 3dmax” and found a couple of links that might help:
@Little Angel
It was not quite like that what we wanted to do. From my view Unity has some problems if it doesn’t not allow you to directly choose what you want to put in each UV channel, but I suppose we’ll have to work with it as it is.
The topic can be closed now. We’ve managed to solve the problem with a work-around.
It seems you’re not being understood properly in this thread. I know exactly what you are trying to do, and it’s actually a pretty common practice in game development, what you are trying to do.
Unfortunately, the option or feature you are attempting to use is not exposed in the Unity interface and was never implemented. In order to use different textures with multiple UV sets on your asset, you will need to code this into a custom shader and/or create a custom inspector that implements this feature so that artists on your team can use a GUI to select the specific UV set to use per texture. For example, in Unreal 3, you can have 4 UV sets per object, and in the material editor you can use a UV coordinate node to select the UV set you would like to use for a specific texture. You can cleverly use this to apply normal maps, displacement maps, emissive maps, detail maps, etc. to different UV sets- really opens up an unlimited amount of possibilities for making custom shader effects and such. So yes, I understand completely what you are attempting to do, but like I said it’s not a feature implemented or exposed in the Unity editor- but you can always custom code this stuff into your own shaders or in the editor.
i3DTutorials: I must be missing something, and I am by no means what do ever a shader expert. I’m much more of a shader n00b. What I was seeing was one model with one layer of materials. The two different UV sets were on different parts of the model, not overlaid upon each other. I could see the need for two sets of UVs for different effects, like using Unity’s lightmapping on the second set of UVs overlaid upon the base set of materials.
What I don’t understand is why one would need two sets of UVs on a single model needing (afaict) a single layer of materials.
Now I’m completely unclear how Max handles it’s texturing and UV’s, so I may be off base, but: With a single model needing a single layer of materials, why would one need a second UV channel? As opposed to having one UV channel, with the UV’s assigned to two different materials, each with their own texture map?
Not meaning to be snarky, but genuinely curious… and as I said, I could be fundamentally mis-informed.
You know how you can use 2 UV sets for lightmapping; one for textures, one for lightmap? Well that same technique can be used to achieve other effects, not just lightmapping; using multiple normal maps, different detail textures, self illumination effects, animated textures- the possibilities are limitless, as the artist can use this to create an unlimited amount of possible surfaces for game assets. Make sense?