Game Development Reference
In-Depth Information
Every mesh in Unity features lightmap UVs in some form, regardless of whether they're really used
in-game. Like regular UVs, lightmapping UVs are a set of mapping coordinates for meshes. Standard
UVs define how regular textures, like Diffuse and Bump textures are projected onto the mesh surface
in three-dimension. In contrast, lightmap UVs help Unity and the Beast lightmapper understand how
to project baked lighting (such as indirect illumination) from lightmap textures onto the mesh surface.
If your mesh has only one UV channel (UV1), then Unity, by default, will use that channel also for
lightmapping UVs. There are occasions when this choice may not be troublesome: such as when a
mesh has no overlapping or tightly packed UVs.
But usually, it's a good idea to avoid using UV1 for lightmap UVs. It's usually better practice to leave
UV1 reserved for standard mapping, and have UV2 (a second and separate UV channel) for lightmap
UVs. To achieve this, however, a mesh needs a second UV channel, and there are two main options
available for creating this channel. One method is to create the channel manually in your 3D modeling
software—the steps for doing this are software specific. And the second method is to have Unity
generate a second lightmap UV channel. This latter approach is achieved by selecting all appropriate
meshes in the Project panel, and then by enabling the Generate Lightmap UVs check box from the
Object Inspector. For CMOD, lightmap UVs should be generated for all meshes (see Figure 2-7 ).
Figure 2-7. Unity can generate lightmap UVs for imported meshes with only one UV channel
 
Search WWH ::




Custom Search