2 UV's on one Mesh [and free hug!]

I’m sorry to come across as a total newbie on this, but truth is, I haven’t done a multi-UV character before in Unity.

I did search the forums but what I could find was way beyond my knowledge so if you could tolerate me and perhaps explain in baby steps what I’m doing wrong, I might give you a hug.

Here we go:
My fish model uses 2 UV’s, 2 materials.
When I import it, the eyes are black, but the body is visible.
When I click ‘swap UV’s’ and hit apply, the eyes are visible, but the body is black.

Attached two pictures that show what I mean.

Now, what steps would I take to make sure Unity shows both the eyes and the body?

Sorry to be noob on this.
Any help would REALLY be appreciated (remember that hug, you know you want it!)

-TT

The problem lies in your non-standard approach. None of the builtin Unity shaders will texture your character properly.

What I don’t understand, is why it looks right, when you swap the UVs. If your UV1 and UV2 don’t overlap, and your eyes are using the same texture map as the body, then there’s no point in using two UV sets. A screenshot of the texture(s) and UV maps would help us to understand your situation.

yeah, I’m also curious why your using two UV sets? You should only need one. Btw, what 3d app are you using?

Thanks guys;
I might have not explained the problem very clearly.

The eyes are mapped to one texture (since they are so big and need a different shader), the body mapped another texture.
However, it’s one mesh on one rig.

The model was created in Maya, but these screenshots are inside Unity.
When I open the exported FBX in Cinema4D though, I also get the same black eyes.

Does anyone know how to fix this (In Unity?).
It does support 2 UV maps, so this has to be possible…

-TT

Ok, I see what your saying. It’s been a while since I’ve used maya. But is there a way you can create clusters? For example, If I was exporting this out of XSI I’d place the body geometry in one cluster with it’s own material. And the eye geometry in another cluster with it’s own material. It’s all the same object, but two seperate clusters.

Skylebones clusters it’s like uv sets ?

Sorry, I wasn’t thinking about this correctly. Ignore this.

The reason that one material or the other works fine, is that all the builtin Unity shaders use UV1 for diffuse color. As I said, you’ll need to edit a shader if you want the behavior you seek. However, I think the approach you’re taking is flawed. Why don’t you just split it into two meshes? A separate mesh and a material are the same, performance-wise.

I don’t know what this “cluster” thing is. However, if it allows you to have separate UV sets for different parts of the mesh, it’s perfect.

Well, pretty much. Each cluster will have it’s own UV set 1, and the object as a whole with use UV set 1. When you export that single object out as an .fbx it will export out as one object, but in unity it will separate the clusters out so each one has it’s own material. That way they all use UV set 1 and avoid this problem.

Honestly, I don’t know anything about Maya either.
One of our super talented team members made this character.

Is there any way to fix it from within Unity?

-TT

The only way it would work in Unity, anyway, is if the clusters were split into multiple meshes, via the .fbx export process. So if you don’t know how to use clusters, then trying to do this in Unity is just going to be a pain, that would be dealt with appropriately in your modeling/animation app.

Using multiple UV sets is generally for things like lightmapping. For multiple materials on one character, you use submeshes, and one UV set.

–Eric

If it were me, I would definitely just split the model into three parts (body, left-eye, right-eye) within Maya, import them separately (or as a group) into unity, and re-parent the eyes on the body.

Not just to solve your material/texture issues - but also, I would be wanting to get them big old eyes looking at stuff independently of the body to bring the character to life…

R.

I don’t see why you’d need to worry about any of that, nor do I see how that would work with a skinned mesh.

RobbieDingo is correct. If you have two separate materials, using two seperate uv’s is not what you want. The artist should split the model into at least two sub-meshes (body and eyes). How this is done in Maya I don’t know. Perhaps an artist can help you with that.

Once your artist has fixed that, you can simply add two materials to the renderer of the model, one for the body and one for the eyes.

Couldn’t you tell the team member that made it to separate the objects out and resend you the new file?

oh, I missed the part where he said it was rigged (and therefore it’s a skinned mesh) - but in any case, the point I was trying to make was similar to yours Jessy - ie. split the model into separate meshes.

But since you mention it Jessy, as an afterthought it could still work quite well the way I said, just by scripting the bones of the body to wiggle, from the root bone of the head down to the tail, whilst independently scripting the eyes (which are not part of the skinned mesh, but rather just carefully parented to the root bone position) using a ‘LookAt()’.

Scripting this character to life, rather than using animation files, could be quite cool… There’s always more than one way to skin a… fish.

Anyway, hope you get it sorted Tornado222, its a funky looking model, I particularly like the tusks.

Hey guys ! Actual how say before it’s riged model, and eye actual have a bone for animation.
So right now it’s 1 riged mesh with 2 UV sets and 2 different materials. Just need find way how make UNITY show this material in same time, script (use mesh.uv2 ?) or special shader ?

P.S Sorry for my english

Neither…as said before, it needs to use one UV set, and be split into two submeshes. Each submesh will use a different material. I don’t know Maya, but this should only take a minute and won’t fundamentally change how the mesh works or anything.

–Eric

One UVset possible use without seperate. Point is use more hires texture for eye’s. But yes one of possible way it’s a seperate mesh on two pieces and rigi it like one and use for each pieces own textures.

But questions is still open. Possible make it in unity ? When we use 1 mesh with 2 uv…

Thanks for answer.