Game Development Reference
In-Depth Information
Figure 2-40. The splat map's alpha channel
You may be wondering if four textures are the most you can use on the terrain. If you note the name,
SplatAlpha 0 , the element 0 may clue you in. If you are new to scripting, you will soon find out that
array elements always count from 0, indicating that there could be more splat map elements. So
it turns out you can have multiple splat maps. Do be aware that each would be one more 1.3-MB
texture added to the project and cause the terrain to be rendered again on top of the first splat map
in an alpha-blended way.
Populating the Terrain
The next step in the terrain-creation process is to add some foliage. Unity handles trees differently
than it handles plants. Plants also have two options, one for billboard planes and one for regular
meshes. Each of the three foliage types has its own functionality and peculiarities
Tip A Billboard object is a texture map with an opacity channel that is applied to a plane. Unlike a
real-life billboard, in game engines the planes always turn to face the camera. In Unity, all trees used
for terrain automatically have an image generated for the planes when you load them into the Terrain
component's Paint Trees section.
Unity's Terrain Assets include a single, nice palm tree you can use to populate your test scene. You
can also use the BigTree that comes with the Tree Generator package. You have already seen a
couple of grass textures that you can use for the “grass” style detail foliage. That leaves only the
detail meshes with no samples for this test terrain. You could try your luck with some free models
from the Asset Store, but because of the way the Terrain component handles these meshes, not all of
the assets available will be well behaved. Fortunately, the topic's project requires a few specialty plant
meshes that have been set up to work well with either the Terrain system or as standalone meshes.
 
 
Search WWH ::




Custom Search