Importing and using custom baked lightmaps and UVs in Unity 5

To avoid using Enlighten on a large exterior arch viz scene, we are unwrapping and baking in 3ds Max with Vray.

We have successfully unwrapped and baked our geometry in Vray+3ds Max, and have successfully assigned the lightmaps to the geometry in Unity 5 using the attached script “SetLightmapsManually.cs”.

When we press play or build the scene the lightmap info is lost.

How do we stop this happening? We need to save the lightmap array and the index info on the objects somehow.

2258225–150960–SetLightmapsManually.cs (1.51 KB)

Also interested in this. Please someone answer. Thanks.

Just use your lightmap textures on the Legacy->lightmapped shaders

When you press play, Unity reads the lightmap index and offsets from lightingdata, you need to run your custom code once during runtime to set your own settings.