8

Using Illumination Maps 615
You should not have more than 65,536 faces
in any of the objects that you want to use with
mesh-to-texture or il luminat ion m aps. Each face
might create a unique texture, and each texture
requires a unique material ID. 3ds Max imposes a
limit of 65,536 on the material ID va lue.
If your game engine can apply only a single UV
coordinate map on a face, y ou need to be careful
about the mappings on the faces.
Don’t face-map coplanar connected faces.
Whenthecoordinatesystemisbuiltforthe
illumination map, 3ds Max tr ies to use the
coordinate system on the faces. If the face
UVs overlap, then 3ds Max cannot use them.
Acoordinatesystemwillbecreatedforthe
illumination map, but you w i ll not be able
tousethesamemapforthediffuseandthe
illumination maps.
•Watchoutfordegeneratemaps.Thesemaps
appear as streaks in 3ds Max v iewports, or
when rendered. Watch out for the top and
bottom of a cylinder and cone. If y ou want
to clean up the UV map, apply a UVW map
modifier and t hen collapse the stack.
3ds Max w i ll war n you when it cannot match up
the illumination and diffuse maps. 3ds Max als o
places the correct coordinates for the illumination
map in the second UVW mapping channel, so
your game exporter can use it.
Game-Engine Ex por t
Illumination maps can be useful with game
engin es. Once the illumination maps are imported
into 3ds Max, your game engine exporter will be
able to export them to your game engine. A few
things to b e aw are of:
Maps are generated for coplanar clusters
of faces. You can have the game exporter
extract the pixels for a face from maps, or
you can put coplanar faces on different layers
topreventthemfrombeingclustered. Each
face that requires a different illumination
map, UV offset, or UV scale also needs a
different m aterial for the face. is handled using
a multi/sub-object material. You might find
thousands of m aterials assigned to a single
object.
The illumination map and diffuse map might
use different UV offsets and scales.
If you want multiple illumination maps packed
into a single texture, you will need to write the
tool to do this. You should take care about
using the Fill Color for t his purpose. The fill
color mig ht b e drawn along the edges of a
face. Increasing the antialiasing wi ll reduce the
regions where the fill color is drawn, but might
not completely eliminate it.
Procedures
To build illumination maps:
1.
In Lightscape, export your model to a LP file.
2. In Lightscape, create a radiosity solution.
3. In Lightscape, convert faces that are not
textured to textures by using Mesh To Texture.
Turn on Pad Tex ture E dge i n the Me sh To
Texture wizard to ensure that textures mes h
well at face boundaries. Replace the maps on
the surfaces, and reset the mesh.
Tip: You might want to use a single-pixel texture
when you want to use an illumination map with
facesthatarenottextured.Thiswillhelpyou
correctly adjust the brightness and contrast for
the model.
4. Tu r n on tex tures.
5. Increase the contrast and reduce the brig htness
untilyouaresatisfiedwiththedynamicrangeof
the il lumination on the textured faces. At first
the model w i ll look dark, but in the next step
you wi l l use the texture scale to compensate.