Game Development Reference
In-Depth Information
As seen in Figure 2-7 , when the Generate Lightmap UVs check box is enabled, additional options
are revealed in the inspector, which influence the generation process. Typically, if your meshes are
hard-angled environment meshes—with sharper 90 degree turns and corners—then the default
settings will likely prove sufficient. If your meshes are organic, curved, spherical, and smooth,
then better lightmap UVs can usually be generated with higher values for the Hard Angle setting.
For CMOD, the default settings will be suitable.
Note More details on generating lightmap UVs can be found at the Unity online documentation at
http://docs.unity3d.com/Documentation/Manual/LightmappingUV.html .
Step 5: Planning and Configuring Textures
CMOD features only one texture, namely a 4096×4096 atlas. Its dimensions have been chosen
for two reasons. First, it's a conventional power-2 size. Nearly every texture, except a GUI texture
or dedicated sprite, should be a power-2 size, for both performance and compatibility reasons.
However, the texture need not always be square. In short, a power-2 size means the texture's width
and height (in pixels) may be any of the following sizes: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,
2048, and 4096. Second, 4096 has been chosen, as opposed to any other power-2 size, because it's
the largest size supported by Unity and our target resolution is not clearly defined or known (I want
to support many screen sizes, resolutions and platforms).
By making textures to the largest size possible therefore we can always downsize, if required, through
all the possible sizes that Unity supports. This is always preferable to making textures smaller than
needed, because upsizing always incurs quality loss and blur, due to resampling. In general, make
textures exactly the size you need, and no smaller or larger. This is because all resizing involves
resampling. But if you're not sure about the sizes required, or if you need different sizes, then always
create your textures at the largest size, since downsizing incurs less degradation than upsizing.
Note Through the Texture Properties dialog in the Object Inspector, Unity offers built-in features for resizing
textures “nondestructively.” That is, for resizing textures up or down, always based on the original. You can
simply select a texture in the Project panel and then pick a new size for it (see Figure 2-8 ). Of course, this
still involves implicit resampling and quality loss as described earlier, but the resized versions are always
generated from the original imported texture and not from any other resized versions we may have generated
previously. This means any quality loss incurred through resizing is not accumulative, even if you resize
multiple times in succession.
 
Search WWH ::




Custom Search