Nexus 1 opengl driver problem

by Carlo » Sun, 14 Feb 2010 16:16:45 GMT

Sponsored Links

We are facing 2 issues on the nexus 1 using opengl  ( under NDK ) :

1)      glNormalPointer(GL_BYTE, x ,  y);       does no work, there no lighting
done on any model using normals stored using byte, the same code is
working properly on a motorola droid/milestone.

2)   Changine Lighting states are very slow and freeze the display
frame for 1 sec on the Nexus 1, we are using dynamic light ON/OFF  and
i am under the impression that is because of the emulation of the
opengl 1.x pipeline under a 2.0 pipeline -> some hidden upload of
shaders of some sort in the drivers, but this is to a point that there
is no way to use realtime lighting on our game for the nexus 1 so
somebody has to look into this issue.

If somebody has some advise to share, workaround, how to  fix those 2
issues , I'll be very happy to hear from you.

thank you,



Nexus 1 opengl driver problem

by Carlo » Sun, 14 Feb 2010 16:35:50 GMT

 Btw glNormalPointer(GL_SHORT, x ,  y);   too is broken, just GL_FLOAT
are working, that's not helping the bandwidth saving for the nexus 1


Sponsored Links

Nexus 1 opengl driver problem

by Ralf Schneider » Sun, 14 Feb 2010 17:19:51 GMT

 Hello Carlo,

Im using the NDK, but I don't think this makes a difference

1)      glNormalPointer(GL_BYTE, x ,  y);       does no work, there no
GL_FLOAT seems to work.

I do not experience this kind of slow down on the Nexus One.
Enabling/Disabling GL_LIGHTNING while rendering a frame works fine for me.

May be the problem is specific to some settings? So for the record I'm using

Display:setEGLConfigChooser(5, 6, 5, 8, 16, 0)
Datatypes: GL_FLOAT for everything
TextureMaps: 8-8-8-(8)
Vertex Colors: None
VBOs: None
Lights: 1
Fog: Linear
Average Scene: After basic frustum culling 10000 Triangles per frame are
sent to OpenGL
Other: glShadeModel(GL_SMOOTH);
    glFogf(GL_FOG_MODE, GL_LINEAR );

... I know these settings cry for optimizations, but currently I'm mainly
experimenting with some basic stuff.
I'm still amazed by the performance. It seems you can easily push 300000
lighted tris/sec. After some optimizations probably even more.



Nexus 1 opengl driver problem

by Carlo » Mon, 15 Feb 2010 10:17:36 GMT

 hanks for your feedback :)

Do you push optimized triangle list indexed, triangle list or strip in
your scene ?

well, from our experience here, If you have a common setting that you
do not change we do not see this problem, let's say you have 1 light
set and keep it this way, however if you have a scene with multiple
texture, 2 or 4 point lights that you turn ON/ OFF independently,
color material, enable disabling LIGHTING between rendering batch of
geometry then we start to see some very strange hang which i do not
explain since the exact same opengl code works perfectly on the droid/
milestone (smooth as butter).
For the Normals, just FLOAT is working and so we will use FLOAT but
still that's broken as we should be able to have support for BYTE for
normals too.
As for the performances, 300 000/s (while ok) are far away from the
22millions/sec (roughly 1.5%) listed on the qualcomm spec for the
snadragon :

(wonder where they took this number out of)

Performances drop very sharply if you turn on more than 1 light
(specially if point light), there is no such of performances drop on
the SGX PowerVR which still maintains high performances from what we
can tell ;)

We are still experimenting too see how we will "workaround" this
trouble that we are facing....

On Feb 14, 6:18pm, Ralf Schneider <> wrote:


Nexus 1 opengl driver problem

by Robert Green » Mon, 15 Feb 2010 14:34:26 GMT

 f the snapdragon chip follows suit with the MSM7200, GL Lights will
cause the CPU to be involved in calculations, which is why you'll see
a big performance hit.

Check out all of these brew whitepapers from Qualcomm. They talk
about lots of that stuff:

On Feb 14, 8:17pm, Carlo <> wrote:


Nexus 1 opengl driver problem

by Ralf Schneider » Mon, 15 Feb 2010 16:50:44 GMT

 Hi Carlo,

well, I'm currently really only experimenting with zero optimizations - one
could say I nearly make everything wrong regarding performance. So you can
treat all my answers and numbers as a worst case.

2010/2/15 Carlo <>

 I push indexed triangle lists. Vertex data is sorted by first occurrence of
an index. I'm currently not using interleaved buffers. No VBOs.

Ok, compared to this my scene setting is currently very simple. One
directional light.
Enabling/Disabling this light does not hurt performance.

For the Normals, just FLOAT is working and so we will use FLOAT but
While I have doubts about the 22million/sec (may be: no colors, no lights,
no texture, screen size of tris: 1 pixel ??). I'm pretty sure if I switch to
VBOs, use 565 textures, ... I can increase performance dramatically.

Fill rate is IMHO a bigger problem. An "overdraw" of 2-3 seems to be the
limit. Using vertex colors and multi textures even an overdraw of 2 seems to

Hm, that's bad. For my current project I can probably live with one light
source, but in general this is not much.


Other Threads

1. How to run the latest version of Android

Hi, I'm trying to do some work on the location framework, but I can't
figure out how to install and view my changes.

I've tried looking this up, but I get the impression I don't know the
right terminology.

Essentially, what I'd like to do is this:
1. Download the donut source
2. make changes to it
3. Run those changes in the emulator to test them out
4. Once the changes are proven to be good, run them in my dev phone

So far, I've gotten through downloading and making the android code,
but I can't figure out where to go from there. Can somebody give me
some advice as to how to get steps 3 and 4 working?



PS - I posted this on the android- beginners list, but was redirected
here. The original post was:

2. IOException while reading a raw resource.

I'm running into a strange problem while reading from an InputStream
on the Android platform. I'm not sure if this is an Android specific
issue, or something I'm doing wrong in general.

The only thing that is Android specific is this call:

InputStream is = getResources().openRawResource(R.raw.myfile);

This returns an InputStream for a file from the Android assets.
Anyways, here's where I run into the issue:

bytes[] buffer = new bytes[2];;

When the read() executes it throws an IOException. The weird thing is
that if I do two sequential single byte reads (or any number of single
byte reads), there is no exception. Ie, this works:

byte buffer;
buffer = (byte);
buffer = (byte);

Any idea why two sequential single byte reads work but one call to
read both at once throws an exception? The InputStream seems fine...
is.available() returns over a million bytes (as it should).

Stack trace shows these lines just before the
at android.content.res.AssetManager.readAsset(Native Method)
at android.content.res.AssetManager.access$800(
at android.content.res.AssetManager$

Changing the buffer size to a single byte still throws the error. It
looks like the exception is only raised when reading into a byte

Any help is appreciated! Thanks!


3. Any way to transfer Android ID from App environment to Browser on Android phone

4. view.draw() at horizontal offset?

5. Very basic questions about porting and my linux based phone.

6. Loading large assets

7. Using setCurrentTab on a TabHost in landscape mode doesn't work. (in emulator)