I’ve made a simple test model in 3ds Max consisting of two intersecting planes (exported from 3ds Max as an FBX file). Each plane uses a different material. The mesh has two UV channels: the first channel maps the textures and the second channel consists of an automatic flatten unwrap performed by 3ds Max for the illumination texture (for this example, I’m using an ambient occlusion texture as the illumination texture rather than a lightmap, but that doesn’t affect the issue at hand).
Once imported into Unity, the object’s two materials work properly if set to use a legacy lightmapped shader: the lightmap texture uses the second UV channel and is mapped to the object correctly. However, if the object’s materials are set to use a self-illumination shader, the second UV channel is ignored and the illumination texture is mapped to the object using the first UV channel. The image below illustrates the problem.
[9619-comparison±+self-illumin+on+left,+legacy+lightmapped+on+right.png|9619]
The object on the left uses a self-illumination shader for its materials; the object on the right uses a legacy lightmapped shader for its materials.
The two versions of one of the object’s materials are shown in the image below.
[9620-comparison+of+shader+settings.png|9620]
Is there any way I can make the self-illumin shader use the second UV channel when mapping the illumination texture to the model? If not, what are the disadvantages associated with using a legacy lightmapped shader? Should I just write my own version of the self-illumin shader that uses the second UV channel when applying the illumination texture?
Any thoughts on this would be appreciated!