Game Development Reference
In-Depth Information
There are six more plants that must use a two-sided, Transparent shader: Carrots, Kale, Radish,
Seedling, Sprout, and the CornStalk's CornTassel material.
6.
Change those objects' materials to use the Nature/Tree Soft Occlusion
Leaves shader.
When you use any of the the Nature shaders, the objects' assets would have to be added to a folder
with “Ambient-Occlusion” in its name in order for shadows to be calculated on them if they were
being used as terrain Trees or Detail Meshes. Those shadows are added as vertex color, darkening
the object when its vertices lie within a shadow cast by another object. Because the garden plants
will be dynamically planted at run-time and are not Detail Meshes or Trees, they will not be receiving
shadows, so you can turn the ambient occlusion settings down for each. If the term “ambient
occlusion” is unfamiliar to you, think of it as the darkness in cracks, small holes, and other surface
areas where light is occluded. The ambient occlusion settings will produce undesirable results on
plants that are not being used as terrain Trees or Detail Meshes.
7.
Turn the Ambient Occlusion and Direct Occlusion values to 0 on each of the
materials using the Nature/Tree Soft Occlusion Leaves shader, and adjust the
Base light values until you are happy with them.
The remainder of the objects don't require opacity but a few should have a double-sided shader. At
this point, however, you may decide that a bit of specular highlight has a better visual impact than
having all of the leaves render on both sides. The corn leaves in particular may be better off. The
SunFlower has duplicate geometry for the backside of its foliage to work around the shortcomings of
the Specular shader.
8.
Assign the Specular shader to the Cabbage, CornStalk, CornYoung, and
SunFlower.
9.
Adjust the Specular Color and Amount to your taste.
Specular shader helps to give the plants a more realistic look than the Nature shaders and can also
receive and cast dynamic shadows. To have a shader that includes double-sided, transparency-
respecting, specular highlighting and casts shadows requires a lot of resources to render, so it's not
surprising that Unity doesn't ship with one.
10.
Clear the console.
Creating Prefabs
Having spent a bit of time processing your imported assets, both textures and models, you've
probably realized that a lot of the setup, because it was done in the Hierarchy view, will have to
be redone if you wish to re-use the objects in a different scene. To avoid doing so, you can create
prefabs from all of the objects you are likely to use again. Prefabs can contain almost all information
an object or objects require to function correctly in your scene. They allow you to quickly re-use
assets in multiple scenes or levels and also to instantiate them into a scene at any given time.
1.
Switch the layout to the 2 by 3 setting, and change the Project view back to
Single Column Layout.
2.
In the Project view, create a new folder and name it Prefabs .
 
Search WWH ::




Custom Search