Hi Guys,

That's a nice list Philip. Just a couple of questions about it.

When you say RBGA_8888 and ALPHA_8 are you talking about the pixel
format of the gl context? What is the benefit of one over the other?

I had input problems until I put a wait in my onTouchEvent, but I was
wondering how the notify in onDraw helps?

What do you mean by the on demand drawing?


I had great trouble trying to get a stable frame rate even with all
the things listed, but my problems appeared to have been caused in
part by the rotation bug in 1.5. I occasionally got a good frame rate,
but then other times didn't. That's one reason I started using VBO's,
just to speed things up. As soon as I got 1.6 I could easily get a
decent frame rate.

It sounds like VBO's are broken on a lot of the newer phones so maybe
I should pull them out and see how it runs. With a bit of tweaking I
should be able to switch VBO's on and off in my code easily, so maybe
I could target individual phones if they really help with performance.

My code currently doesn't use Vector objects due to the gc involved
when they are created and destroyed. Anyone found a nice way of
getting round that?

Cheers,
Mike



On Jan 14, 11:34 pm, Philip <[email protected]> wrote:
> My experience so far:
> - Create your textures in power of two and make sure you scale and
> clip them to the right ratio when you draw.
> - Don't stick to RBGA_8888 when you can do ALPHA_8 (text rendering)
> - Do whatever you can do in OnSurfaceCreated before you get called in
> OnSurfaceDraw
> - Avoid the GL11 context cast. Some things won't work e.g glColor4ub
> will compile but not work.
> - Balance your calls of enable and disable for each component draw
> your call into your scene graph.
> - Pre-allocate your nio buffers
> - Use DrawElements but for the simplest shapes of one vertice
> - Test on as many devices as you can. Just don't settle for the
> emulator e.g. non power of twos work on emulator but not on the phone.
> - If you can then use the on demand drawing.
> - Use the trick of putting a wait in the onTouchEvent call for 20ms
> and a notify in your onDraw to reduce the deluge of motion events you
> have to process. You can bypass onTouchEven and use a lower call to
> save some cycles as well.
> - Use texture atlas as much as you can e.g. to draw score and text or
> animations
> - Disable the fancy rendering options (DITHER_TEST etc...) Unless you
> crave a realistic rendering on textures.
> - If you draw in 2D, then disable the DEPTH_TEST
> - Don't forget the Bitmap.recycle() call when you are done binding
> your textures.
> - Avoid Object creation destruction (PointF Rect) in your rendering
> routines. GC calls will slow down your frame rate.
> - Preload your textures extensively. don't wait until you draw at the
> last minute to bind your textures. The lag is noticable if you do so
> it's better at app start up time.
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to