Custom shader lightmapping UV problems

Currently having problems with light mapping through a custom shader when our team uses version control to share the lightmaps. I’ve had a look around and people mention things about 2nd UV sets and problems with Unity generating lightmap UVs and such.

As it stands, we have lightmap UVs for each object setup in 3DSMax and don’t swap or generate UV’s on any imported objects. However, when we bake the lightmaps on one system and then use the Unity version control, the UVs and sampling on some objects seem to be completely off and look like crap.

I thought at first it was my shader that uses “DecodeLightMap( texture sampled )” but as some objects look correct with the lightmap I am doubtful it’s something with that. I was just wondering whether there are specific settings somewhere that I am missing and whether we need to check in the whole scene aswell as the lightmaps (even though it says no changes have been made to the scene so I don’t actually have an option to check it in).

I found that checking the scene in with the lightmaps seems to solve this, however having to check each scene in with the lightmaps takes a long time.

Also, I have found that there is a large difference in what the subshader looks like in comparison to my own CG shaders in terms of the lightmap. Is there a specific way to sample the lightmap for the colour and to also mix in specular and a reflection map? When I try to multiply in the reflection and add the specular it darkens the texture way too much.

(specular) Reflections are additive (well… it’s a bit more complex with physically based lighting, but let’s not go into that right now), you don’t want to multiply them with the diffuse color.