Game Development Reference
In-Depth Information
{
for (int i = 0; i < vertices.Length; i++)
{
vertices[i].Position = new Vector(
vertices[i].Position.X,
vertices[i].Position.Z,
-vertices[i].Position.Y);
vertices[i].Normal = new Vector(
vertices[i].Normal.X,
vertices[i].Normal.Z,
-vertices[i].Normal.Y);
vertices[i].Tangent = new Vector(
vertices[i].Tangent.X,
vertices[i].Tangent.Z,
-vertices[i].Tangent.Y);
}
}
Check http://deltaengine.net/games/starterkits for the most recent version of the Labyrinth game.
Optimizing for Mobile Devices
Since we've already discussed making the 3D models simple and using only very basic shader rendering features,
additional optimizations for mobile platforms are not really a big issue for this simple game. However, if your game
becomes more intricate and you are using a lot of complex shaders and tons of high-polygon 3D models, you will run
into performance problems very quickly. Not only do mobile devices render much more slowly than powerful GPUs
on the PC, but they range from totally outdated and poor performance (iPhone 3G, OpenGL ES 11, older Android
devices) to pretty decent performance (iPad 3, huge resolution, or PS Vita).
Obviously, trying to optimize all important aspects will help achieve good rendering performance, but more than
anything you should constantly check to see if everything is still running smoothly or if you need to spend more time
reducing content and doing some optimizations yourself. For example, the ContentManager of the Delta Engine will
optimize vertex formats and shaders for you based on your settings, but it will not simplify the overall complexity of
your game. This task is left to the game designer. He has to decide which features are crucial and which can be left out.
If you are using complex 3D models with lots of polygons on PCs or consoles, it makes a lot of sense to reduce them
drastically for mobile devices (level of detail (LOD) for 3D models is nothing new).
As you can see in Figure 3-13 , lots of little tweaks and optimizations can be made for each mobile platform. In our
opinion, most of these settings only have to be established (or at least accepted by everyone) once at the beginning of
a project. It will be hard to convince artists who have worked on PC or console games to limit their creations to those
rules. For example, many artists will argue that 36 bones for an animated model are not enough. The Dragon in the
sample game originally had 40 bones, but we deleted a few and got the number below 36. The limit is not really 36
bones (depending on the platform, you could go up to 80 or 240), but keeping most models below the limits helps
performance. Another important setting for animated models is the number of vertex influences each bone can have
and the fps limit for animations. On a PC, you might allow four influences per bone and save up to 30 or even 60 fps of
animation data, which can easily result in a megabyte less per animation. Consider the following:
80 bones
30 fps for the animation data
 
Search WWH ::




Custom Search