Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Optimizing OpenGL ES Applications for Brew : Page 3

Although OpenGL ES makes 3D graphics programming significantly easier and more portable, developers must still work to tune their applications for the greatest performance possible. This article features tips and tricks gleaned from the experts.


advertisement
Managing Textures
The hardware includes a texture cache. As with all caches, the secret to getting the best performance is to try to operate with cached data as much as possible. Consequently, your first order of business when working with textures is pick appropriate textures—and textures of appropriate sizes—to ensure you don't end up running out of cache. One 128x64 texture fits fine in the cache.

Another trick that helps is to sort your render commands first by texture object and then by state vector. Grouping render commands by texture object helps keep relevant textures in the cache for as long as possible during the rendering process.

While on the topic of textures, it's a good idea to use an appropriate filtering mode for your textures. Linear filtering is fine as long as the texture's cached, but if your texture doesn't fit in cache or for large textures, you're better off with nearest filtering, because the cost of linear filtering can be as much as 15 percent.



A final trick that falls into the category of textures is to simulate lighting with textures. While the OpenGL ES interface has support for lighting, complex lighting can cause enormous slowdowns (up to forty percent in some cases). If you can get away with pre-computing lighting into the texture bitmaps and rendering your models with the appropriately-lit textures, you're better off.

It's Still in Your Hands
While OpenGL ES promises 3D portability to gaming and graphics developers, it's not a panacea. As the developer, you're still responsible for determining how your application performs. Making an effort to tune your implementation will pay off, not just on Brew, but as you port your application to different platforms as well.



Ray Rischpater is the chief architect at Rocket Mobile, Inc., specializing in the design and development of messaging and information access applications for today's wireless devices. Ray is the author of several books on software development including "eBay Application Development" and "Software Development for the QUALCOMM BREW Platform," both available from Apress, and is an active amateur radio operator.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap