Chapter 5

Optimization

WHAT’S IN THIS CHAPTER?

  • Optimizing your indices data by converting them from triangles to triangle strips
  • Optimizing your textures and saving video memory
  • Implementing bump mapping to fake details and improve visual quality
  • Implementing geometry and shader levels of detail
  • Using a texture atlas
  • Conceptualizing how to manage machine states in software to avoid unnecessary GL calls
  • Using the Automatic Shader Optimizer that comes with the SDK

In the previous chapter, you noticed how much the frame rate was dropping as you were adding more and more effects. Many factors affect performance, whether it is the size of your textures, the memory usage, the amount of polygons, or the complexity of your shaders — you need to be able to optimize each of them.

Always keep in mind that you are dealing with a portable device that has a pretty limited amount of resources compared to desktop PCs. However, that doesn’t mean that you should call it a day — there are still many tricks that can be done to improve performance.

This chapter will introduce you to many different optimization techniques that you can easily integrate inside your own games and 3D applications.

THE BASE APP

In this chapter, you will first take a step backward in order to go forward! Instead of creating a new full-fledged scene with many objects, you are going to work with one single object and progressively add the necessary code to optimize it in full.

Now to speed things up a bit, this time you ...

Get Game and Graphics Programming for iOS and Android® with OpenGL® ES 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.