- Home /
Assigning differents textures to two differents Uv sets on one object.
Hi everybody I am a new Unity's user and I have lot of questions that need answers :)
I am working on a game that need ligtmaps to get a better render. In Maya , I did 2 Uv set for a mesh, one for the diffuse color (texture) and one different for the lightmap (in this case it's an ambiant occlusion). I found in Unity how to use these maps in a shader (for instance I am using a lightmapped/diffuse Shader).
I would like to know how can I plug a texture in an Uv set and an other texture in the second Uv set?
As I am using texture tilling in some parts of the diffuse color, I need to overlap some Uv's so that's why I created an other Uv set for the lightmap with no overlaping.
Any ideas?
Answer by duck · Feb 16, 2010 at 04:39 PM
If you have model with 2 UV layers, make sure that you have a texture assigned for each layer in Maya (I haven't used Maya, but in general it seems that FBX exporters need to be prompted to save the 2nd UV set by actually having a texture assigned in that layer). Then export your model to your project's assets folder.
In unity, create a new material, and make sure it is using a a shader from the Lightmap Family. then to actually "Plug In" the lightmap texture, make sure the lightmap texture image is included in your assets folder, then select the Material, and drag the lightmap texture from the project pane into the correct texture slot in the material inspector.
Hope this helps! If there are more specific problems that you're having with this process, please add more detail to your question.
Answer by Branscombe · Feb 18, 2010 at 12:59 PM
Thank you for your help Duck.
Even if I did not assign a second texture on the second uvSet (or channel for Max user), the fbx exporter saved the 2 Uvset and the lightmap shader in Unity use both as default. (the "rvb diffuse" is automaticly assign to the first Uvset, and the "lightmaped" channel of the shader is automaticly assign to the second UvSet) So everything is working by default.
I would like to know if I can control properties of the lightmap file on the unity's shader (something like intesity, blending mode etc..) It's can be probably done by creatine and editing a new shader, but I have not skill in coding of scripting...)
About Unity shaders, I tried to put a "lightmapped/diffuse/bump" shader and plug in it a diffuse texture color, a lightmap and a normal map as bump value. Everything is working but the bump. It's like the normal map do nothing on the bump channel of this shader, don't know why.
I also have a big problem when I attempt to bake Global illumination with Mental Ray in Maya but I think this is not the correct place to ask that.
(sorry for my english, I am trying to do my best to be clear..) :)
You shouldn't have any trouble baking AO in $$anonymous$$ental Ray, it's all about setting up your radiosity solution (try using a semi-sphere with a material with incandescence = 100%) and using the "transfer maps" option inside $$anonymous$$aya. What's your problem specifically?
Answer by Fubiou · May 05, 2010 at 03:54 AM
Well, here it is a real problem because, i am not sure why, but if i export lightwaves fbx it will have only one UV map, so if I export to .DAE and convert to FBX using the Autodesks free tool it will have more than one UV map but I must assign the textures by hand in unity, so, how can I do it? In other words, i cannot export lightmaped things from lightwave 3d
: (
Lightwave's FBX support is quite broken, even in 9.6. Anyways, simply exporting 2 UV sets should work. $$anonymous$$ake sure you have both UVs assigned to one texture each, it can be a texture with no properties at all (eg.: diffuse texture with no image assigned to it), but if you don't assign a texture Lightwave won't export the UV set.
Your answer
Follow this Question
Related Questions
Blend between 2 lightmaps 0 Answers
2 UVs set and need lightmap UV slot 1 Answer
Fixing UV for Lightmap Help me please please please 2 Answers
Using second UV as Lightmap. Slow? 0 Answers
Vertex colour transparency and Beast lightmapping? 3 Answers