Alex Rempel
Alex Rempel

Reputation: 590

Android GLES20 big textured quad very slow (on Nexus One)

I render 2 triangles covering the whole surface using GLES20 context only. The problem is now that drawing just one single texture this way seems to be unreasonably slow. The framerate goes down from 58fps to 21fps.

I'm at a loss here; I thought blitting a single image in GL should be at least as quick as doing the same with Canvas, but it doesn't seem to be the case.

Can someone provide tips or an explanation of this performance hit?

Update:

I just adapted my rendering thread to support a canvas instead of EGL context and I do absolutely the same; showing an fps text and blitting a background texture. Guess what: showing the text only I get 58fps, adding the background picture I get... 57fps!

Now I am officially and very seriously pissed off. I hope that I am just not smart enough to use GLES20 well, otherwise it seems that if you want to blit 2D graphics - you take Canvas; and if and ONLY IF you want many triangles in 3D, then you take OpenGL.

Shouldn't OpenGL be always at least as fast as the 2D API provided by the Canvas?

Upvotes: 3

Views: 1305

Answers (2)

Erik
Erik

Reputation: 812

No offense, but going from 58 to 57 fps for a fullscreen texture is not too bad. Whether 2d or 3d a phone or tablet cpu/gpu will always be fillrate limited.

Upvotes: 0

the swine
the swine

Reputation: 11031

this is probably caused by large texture size and no mipmaps (because then the memory accesses can't be optimized very well), or by the texture not being power-of-two (because then the address calculation is harder - need to use multiply instead of a shift).

Hope this helps ...

Upvotes: 1

Related Questions