Holistic Mobile Game Development with Unity by Penny de Byl

Holistic Mobile Game Development with Unity by Penny de Byl

Author:Penny de Byl [de Byl, Penny]
Language: eng
Format: azw3, pdf
ISBN: 9781135038946
Publisher: Taylor and Francis
Published: 2014-07-11T04:00:00+00:00


Set the Range to 50. You can modify this as you see fit later. This value determines how far into the environment the spotlight reaches. Duplicate the spotlight by right-clicking on it and selecting Duplicate. Take the duplicate and child to the Main Camera under the Mobile Controller, ensure its position and rotation are still set to (0,0,0).

Play. Just by making the environment dark you’re invoking emotions of fear, uncertainty, and anticipation.

Step 4: If you have an old mobile device then chances are, as it stands, the current version of the game will struggle to run as there are about 194 drawcalls. This needs to be optimized as the spotlight feature itself requires a lot of GPU power. The first thing you can do is reduce the camera’s far plane. The more objects inside the frustum, the more drawcalls. In this case, trees that are far away from the player don’t need to be visible and we can use the camera to cull them as shown in Figure 4.36.

To limit the far plane, select the Mobile Controller’s Main Camera and set the far plane to 20. This will bring the drawcalls down to around 50. With this number, older devices will still struggle.

Step 5: As we are using a Unity Terrain and trees painted onto the mesh, you can control the detail and distance of the trees and their details. Select the Terrain and in the Inspector reduce the values for the terrain trees as shown in Figure 4.37. As you change the values watch in the Scene how the trees change. You’ll notice that you can determine the distance at which the trees become billboards. This means the trees in the distance will be represented as flat billboards, further reducing strain on the processor.

FIG 4.36 A reduced camera frustum.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.