I’m a bit stuck getting a light-mapped, UV mapped material working.
I have a Lightwave model with two UV maps. The first map “UV Texture” is used for diffuse, the second map “UV Light” is used for lightmap info.
When I import the model to Unity, the diffuse texture is applied correctly using first UV map. When I change the shader to Lightmapped/Diffuse, my lightmap texture is applied incorrectly using the first UV map, instead of the second UV map.
Anyone know what I’m doing wrong? How can I get the shader to use the second UV map for my lightmap?
Hey Proto,
Im no lightwave guy, but I have imported both Maya and cheetah lightmapped models with 2 uv sets. the shaders just work automaticly so I feel Sure you have to set up things in your modelling app. In maya the usual mistake is not redirecting the second texture to the second uv. Once its sorted, it should just work. maybe try exporting to fbx and see if that works. hope that helps
AC
Which material attribute is Unity expecting the lightmap to be applied to? I’m guessing luminosity, and although that looks fine in Lightwave doesn’t seem to have been recognised by Unity.
I’m guessing that Unity places no restrictions on the type of each UV map? i.e. Does it matter that I’ve used atlas mapping with unique UV coords to create a big lightmap of all my walls and objects, and an overlapping tiled UV map for my repeating diffuse texture?
That sounds perfect. If you want a second opinion on an fbx version, Im happy to take a look.PM me if so. Actually I think cheetah can read .lwo’s so that might be a way to check.
AC
I’ve attached a quick sample scene with objects and textures.
In Lightwave this has one object with one material, two UV maps:
the diffuse texture is applied to the diffuse material attribute using the diffuse UV;
the lightmap texture is applied to the luminosity material attribute using the lightmap UV;
In Unity, the material defaults to the Diffuse shader upon import. This has then been changed to the Lightmapped/Diffuse shader and textures re-applied.
Result: the diffuse texture is applied correctly using the diffuse UV map. The lightmap texture is not applied correctly and does not use the lightmap UV.
Where I should be seeing the second uv set, Im not seeing any UV’s at all.(In Cheetah) Your unity shader is set up fine.
So its in the application of 2nd set in lightwave, or the export process. Make sure you’ve got the latest fbx plugin at least.
Theres a guy called Richard_Brak who visits the forums from time to time, Hes a lightwave genius who has been baking nice scenes, maybe he could help you with the Lightwave bit?
Thanks for that Targos. Unfortunately the FBX materials do not survive the re-import process into Lightwave via the FBX import plugin, so I can’t see Lightwave’s interpretation of your setup. I checked that I have the latest version.
only dabbled a little with lightmapping. i might be wrong but the conclusion i came to:
the current lightwave fbx doesn’t support multiple uvs per poly. it does support multiple uvs per object. you need to use the same uvs for your diffuse and your lightmap(s) - as in plural, baking one for each uv map in your object. not exactly ideal but i think it’s being worked on. hopefully we’ll see a new exporter soon.
Thanks for the replies all. I’ll raise this a bug as I’m not sure where the error lies, at the very least I hope to get some kind of indication from one of the 3 vendors that this is or isn’t possible.