Texture2D.PackTextures works but the result is horrible!

So, my artists have made a scene that works, but I’m trying to do some optimization. We’ve got a fair number of lightmaps in our scene, so I’m trying to, well… post-process them in Unity into an atlas and adjust the uv2 of the appropriate meshes.

So far, I’ve gotten to the point where I can gather up all the existing lightmaps and pack them four at a time into a new texture, which then I’m encoding to PNG and saving to disk, since I don’t want to have to do this at run-time every time.

The problem is that my PNG shows up as empty color channels in Photoshop (CS2, if it matters). It shows data in Unity, but the colors are all blown out. It should be a mostly desaturated lightmap, but… well, look at the attachment, and you’ll see what I mean. What could be causing something like this? The source files were originally all .PSD, but I’ve tried .PNG and .TGA as well. I’ve also set the overrides on the texture importer to ARGB32, as that’s the only format that makes the textures look correct to begin with. Any other format type makes them either black, white, or look like I’ve applied the “Threshold” command in Photoshop.

(Using Unity 3.5 Beta)

I guess I jumped the gun on posting… so for anyone who is interested:

The texture importer settings are extremely important in this case. I was packing lightmaps. The texture importer for the textures in question had the Lightmap checkbox checked. I’m not sure what Unity’s doing behind the scenes when you check that box, but that was what was blowing out my resulting packed texture.

Did some troubleshooting by applying the individual maps that were about to be packed as the main texture of an unlit shader, and hitting the spacebar cycled through the source maps and the packed map. Even the source maps looked horrible, so that’s what lead me down this route. Unchecking the Lightmap setting in the importer also allowed me to use all of the other available format options as well while leaving the texture relatively unchanged. I guess Lightmaps don’t like being anything other than DXT5 and ARGB32.

tl;dr: Don’t try to pack textures with the Lightmap option checked.