Game Development Reference
In-Depth Information
updating, but it has a few drawbacks. Most of the proprietary formats require the software to be
installed and licensed in order for Unity to be able to use the content. It also is destructive. Unless
you are using versioning software (where version changes are backed up and saved), if you want to
revert to an earlier version of the asset, you will have no means of doing so unless you are backing
up your
files externally.
The safest and most versatile file type for 3D assets is .FBX. It carries very little unneeded overhead
and can be read and used by anyone.
Textures
Unity supports all image formats. Internally, most images are converted to .dds for desktop
applications. For mobile, they are internally converted to the appropriate format for the selected
platform. The bottom line is that you do not have to worry about the texture's original format. This
allows you to work in Photoshop or other image-authoring applications, leaving layers intact.
Because Photoshop layers are a means of preserving the history of an image's creation, you have
the freedom of editing the image while it resides in the Unity project.
In Unity, as with any real-time engine, the optimal image size should be a power of 2. Use 32 x 32,
64 x 64, 128 x 128, 256 x 256, etc. to conserve memory. (See Figure 4-1 .) Images that are over the
base 2 size will take up the same amount of memory that an image of the next power of two would.
The Texture Importer allows you to cap the image size, so you needn't worry about images that are
too large unless you prefer to do your own size reduction manually.
Figure 4-1. Texture memory usage
In Figure 4-1 , the image on the left uses a 256 x 256 block of memory. The image on the right, retaining
its original proportions and size, uses a full 512 x 512 block of memory (four 256 x 256 blocks).
Once an asset is imported, you may need to change the import settings, depending on the function
of the imported texture. In Chapter 3, you had to change the import settings on a texture that was
going to be used as a hardware cursor. Textures that are going to be used in 2D space only do not
have to be MIP mapped. MIP mapping is the process by which an image is reduced in size, base-2 of
course, and is smaller and blurrier for several iterations. The smaller, blurrier versions are used farther
back in the scene to prevent “artifacting,” which is the visual effect of the engine trying to decide
 
Search WWH ::




Custom Search