Header Sep
Mobile Java 3D Tips, Tricks & Code
 
My Rating Score
Login to rate page

December 2005
3D hardware optimization tips for the W900

[Back]

 

The Sony Ericsson W900 Walkman phone has hardware-accelerated JSR 184 implementation delivering top-of-the-line 3D graphics performance, as demonstrated by the embedded Powerball Arcade game. During the development of Powerball Arcade, the optimization tips below were discovered for the W900.

Judging by the performance and quality of Powerball Arcade, the below 3D hardware optimization techniques have great value if developers are willing to put in the time and effort needed to apply them.

Minimize render batches
It's important that you keep the number of render batches as low as possible. In m3g terms, this translates to:

  1. Minimize the number of Meshes. Objects that don't move independently and are close together should be made into one Mesh.
  2. The number of Appearances inside each mesh should also be minimized. Stitch textures together if necessary.
  3. The same goes for the number of strips inside TriangleStripArrays.

Frustum culling
The 3D engine performs camera view frustum culling when retained mode rendering is used (render(World) and render(Node)). However, it is usually the case that having few big meshes is faster than having many small ones, even though less culling will be done. This trade-off, of course, depends on how the camera is set up in your game.

Lighting
Do not use lights. Use per vertex color or light textures (multi texturing is relatively cheap).

If absolutely necessary, you should favor directional lights as they are faster than positional lights (omni directional in m3g) which in turn are faster than spotlights.

Mixing 2D and 3D graphics
Minimize the number of 3D bind-release cycles per frame. If possible, use only one. There is an expensive overhead process taking place when a MIDlet switches from 2D-drawing to 3D-drawing and vice versa.

Avoid flat shading
Avoid using flat shading; it is more expensive than smooth shading. In m3g terms - use PolygonMode.SHADE_SMOOTH instead of PolygonMode.SHADE_FLAT.

More information:

My Rating Score
Login to rate page