Saturday, May 21, 2011

[android-developers] OpenGL on Original Droid "stutters"

Hi

I've been experimenting with the NDK san-angeles example in android-
ndk-r5b for doing OpenGL. However, I've trimmed out all code in the
sample and instead changed it to simply display one texture mapped
cube that rotates (to learn OpenGL ES).

I have a OpenGL "window" of 480x320. I do a simple glClearColor, and
then draw a textured quad using a triangle strip and Vertex Arrays. I
also have a texture array too of course. The texture is Alpha-blended
so I can mask the image out. I then rotate the quad in the Render
loop.

I've noticed on my original Droid the quad sort of "stutters" in the
sense that it will start out rotating normally, and then slow down a
bit, speed up, slow down, and just act weird.

I thought this was possibly a artifact of the frame rate changing a
lot, so I rearranged my code to average the frame rate and adjust the
rotation of the quad based on real time.

However, on the Droid this doesn't seem to make any difference. It
still randomly "slows down". The other strange thing is I can smooth
it out by simply touching the screen and "rubbing" my finger on it
back and forth. As long as I'm rubbing the screen the animation is
nice and smooth. It's weird like some sort of thread priority thing or
something.


I also tested the same exact APK on a Motorola XOOM and on a Samsung
Galaxy Tablet, and they do not exhibit this behavoir. The quad rotates
nice a smooth continously and without and lag/stutter.

Does anybody have any tips or ideas of what may be causing this to
occur?

The slowdown happens even when I disable the texture and only display
the quad (as a white quad).

I've uploaded the code I used to test this if anyone had the time to
check it out:

https://rapidshare.com/files/488012630/san-angeles.zip

Thanks!

-niko

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate