24 January 2013

LightMaps in Unity from LightWave

 

To get realtime shadows in Unity needs Unity Pro, but you can get shadows for static scene objects easily.



  1. Planes are single-sided in Unity like LightWave. Give your objects some volume to get shadows from all sides.

  2. When you bring in your scene, use the Inspector to turn on "Generate LightMap UVs"
  3. (Use the same Inspector to turn on Generate Colliders and switch Material Naming to From Model's Material - it will make your life easier).
  4. Make sure the lights you place in your scene have soft shadows turned on, there will be a warning about Unity Pro being needed for soft shadows).
  5. Unity doesn't show realtime shadows in the Scene view, so use LightWave to make sure they are well-positioned even if Unity's lights aren't directly comparable
  6. You need to make that the Intensity and Range for the lights is good enough too.
  7. Now select everything in your scene- all the lights and all the objects (you can delete the LightWave Camera since it is just a null, the Unity camera by default is called Main Camera).

  8. Open the Window > Lightmapping window and check Lightmap Static, then click Bake Scene
  9. A small window appears giving a progress bar, but this is only preparation for baking. The actual baking progress bar appears in the lower right corner of the interface after the initial one disappears and once that has done you then get a third progress bar as the lightmaps are applied to your objects.
  10. Now you can turn off the lights in your scene content in the knowledge that their effect has been burned into the objects in the scene that can also be seen in Scene View.