Game Development Reference
In-Depth Information
There will be a few more assets to bring into your scene as the game progresses, but they will come
in as Unity packages and will not require extra processing.
Summary
In this chapter, you learned that although Unity supports many file types, both generic and
application-specific, the underlying format is .fbx. You found that there are trade-offs to importing
directly from your DCC applications such as 3dMax, Maya, or Blender. Saving files directly into Unity
is quick, but unless you are using versioning software, you risk not being able to revert to earlier
versions of your assets. Files created in proprietary applications may also require licensed versions
installed on the machines before Unity can read them. To make sure the assets can be used by
anyone for Unity, model assets files should be saved in .fbx format.
With Imported texture assets, you found that Unity can add grayscale alpha channels and generate
normal maps. You discovered that it was easy to keep the textures in your favorite format and size
because Unity lets you specify a maximum size in scene, and it automatically converts textures to an
appropriate .dds format for in-game use.
Once your textures were safely in the project, you brought the model assets in. You found that Unity
generated materials using the main texture for the various models. Scale Factor is the first thing to
check when importing assets. A quick way to do that is to create a Cube with its default size of
1 meter cubed, for comparison. You discovered that models come in with generic Animator rigs that
can be removed by setting the Animation Type to None. Colliders you found, when auto-generated
by Unity on import, were always Mesh Colliders. After examining each of the structures included in
the CornerGarden asset, you determined that most would be more efficient with standard
primitive colliders.
Next you learned how Unity batches” objects to be able to combine draw calls. The main
requirement was that the objects be marked as Static. This, you discovered, was used for both
batching and Lightmapping. With the structures, you had the chance to see how Unity shaders
often use a texture's alpha channel for parameters other than transparency. Upon processing the
plants, you had to decide between several shaders, but found that plants that required double-sided
shaders and transparency were limited to only two choices. Of the two, only one cast dynamic
shadows, and the other was likely to disappear when using Deferred Lighting (a Pro-only feature).
With all of the processing for the imported objects finished, you created prefabs of each of the
objects. This, you found out, would insure that you would not have to go through the setup each
time you wanted to use them in other scenes or instantiate them during runtime. Finally, you learned
how to locate and load an asset directly into your scene via the Unity Asset Store.
 
Search WWH ::




Custom Search