I am starting a separate thread from the service's engine which has
complete responsibility for creating the EGL/GL context. Because of
the interleaving behavior of the events (surfaceCreated/Destroyed/
Visible etc.) of separate engines (is the case with wallpapers because
of preview/real running together some time) I had to be very carefully
to never block my rendering thread for too long and still get all
events right. For example I implemented a delayed resource loader
which loads resource parts in multiple frames instead of doing it once
in one frame.

The thread runs as fast as possible - using the glFlush/glFinish and
eglSwap methods shows then, that the first call to GL (i.e. clear
color) is somewhat slow in every frame, thus slowing the entire thread
down to 60fps. Those seem to be the forced vertical synchronization on
the Nexus One (at least I think so), probably forced in the low-level
rendering pipeline.

Rendering some text quads showing the fps kills ca. 2-3fps - that is
my 57fps "empty screen" time. Filling more pixel areas slows the
system down as I described in my problem overview.

After some more research I thought that the problem was the Adreno 200
GPU fillrate being too weak, even though the feature description says
otherwise. Now I don't really know what the bottleneck really is, but
these seem to be facts:
- yes, Nexus One has bad pixel fillrate (something is too weak for its
resolution)
- no, 20fps with a single quad is not the best You can get

So now I just want to know if somebody had successfully rendered a
single background quad and got ca. 40fps out of it and how this
somebody did that. Until then I don't really see any possibility to
render a decent 2D application in GLES20 using Java only.


On Mar 15, 7:07 pm, ip332 <[email protected]> wrote:
> In my previous project on Windows CE the bottleneck of the GL
> performance was not in the number of triangles or textures size but in
> the synchronization between load/draw threads.
> You mentioned some problems you have overcome already (thread/
> events...) and I simply wanted to see if there are no issues there.
>
> BTW: how did you get 60fps ? How many triangles did you have ? how
> many textures (and their size) ?
>
> On Mar 15, 9:01 am, Alex Rempel <[email protected]> wrote:
>
>
>
> > On Mar 15, 4:27 pm, ip332 <[email protected]> wrote:
>
> > > The size is not an issue, the blending type - also.
> > > Could you provide a complete source code ?
>
> > It's not that easy to do as it is not a simple test code sample...
> > What exactly would You like to see?
> > Info: GL_RENDERER is "Adreno 200"
>
> > Here is the loading part...
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > int[] id = new int[1];
> > GLES20.glGenTextures(1, id, 0);
> > GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, id[0]);
> > GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
> > GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
> > GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
> > GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
> > GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,
> > GLES20.GL_CLAMP_TO_EDGE);
> > GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,
> > GLES20.GL_CLAMP_TO_EDGE);
> > GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0);
> > ...
> > bitmap.recycle();
> > bitmap = null;
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> > Here is the setting to shader part:
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > int location = GLES20.glGetUniformLocation(m_curProgram.id(),
> > strShaderComponent);
> > GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
> > GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, gl_texture_id);
> > GLES20.glUniform1i(location, 0);
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-- 
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