Environment: unity3d4.1,windows8.1
Unity3d can produce better illumination maps, and using them in a program can produce better results.
First, the illumination map offset is obtained
Renderer.lightmaptilingoffset Illumination Map Tiling offset
Description description
The tiling & offset used for lightmap. Tile and offset values for the lighting map.
A scene can has several lightmaps stored in it, and Renderer can use one of the those lightmaps.This makes it possible to use the same material on multiple objects, while each object can refer to a different lightmap O R different portion of the same lightmap.
A scene can store multiple light maps, and the renderer can use one of these lighting maps. This makes it possible to use the same material in multiple objects, although each object can refer to different light maps or different parts of the same light.
The vector ' s X and y refers to the lightmap scale, while Z and W refers to the Lightmap offset.
The vector's X and y are attributed to the scale of the illumination map, and Z and W are the offsets of the illumination map.
Second, light map
The code for the light map is as follows:
GLTEXCOORD2F (u1*x + z, v1*y + W); glvertex3f ( -2.0f, -2.0f, 0.0f); GLTEXCOORD2F (u2*x + z, v2*y + W); glvertex3f ( -2.0f, 2.0f, 0.0f); GLTEXCOORD2F (u3*x + z, v3*y + W); glvertex3f (2.0f, 2.0f, 0.0f); GLTEXCOORD2F (u4*x + z, v4*y + W); glvertex3f (2.0f, -2.0f, 0.0f);
The above UI and vi are texture coordinates that can be obtained through the uv2 of the mesh.
Use of Lightmap in Unity3d