Help improving slow panning of big static drawing. Texture?

Problems with Canvas, OpenGL, etc...

Help improving slow panning of big static drawing. Texture?

Postby mesocyclone » Mon Oct 11, 2010 9:48 pm

I am looking for ideas to improve OGL performance, maybe by rendering into a texture.

My app shows a infrequently changing image with about 360,000 vertices, overlayed onto some other OGL geometry. The "image" takes way to long to render (600ms on a G1). This makes panning (translating) or zooming (changing scale) unacceptably slow.

The key is that the data from which I render the image changes only on user command, and rarely - it is like a landscape in a game - it doesn't change often. It is okay to take a second or two to originally generate that image, but not okay to take that long to redraw it during a continuous (following a moving touch pan.

One idea is to render it (using OGL) into a texture, and then, in onDraw, just draw the underlying geometry and the two triangles holding the texture.

However, I don't see how to do this except to render to the screen, scrape the bits off the screen, rearrange the result into a texture, and display the texture. This is far from desirable.

Is there a way to render into a texture? Googling says no, but maybe something changed with 2.2.

Is there a better way to go about this?

Thanks in advance!
mesocyclone
Freshman
Freshman
 
Posts: 2
Joined: Mon Oct 11, 2010 9:28 pm

Top

Re: Help improving slow panning of big static drawing. Textu

Postby mark@project8games.com » Mon Oct 11, 2010 11:32 pm

I have a few questions...

You said 360,000 vertices. Did you mean vertices or pixels?
Is the image a big bitmap you're trying to render the to screen?
Is the image just a plain 2D axis aligned image?
Does it need to move in 3D space or just 2D?

BTW, full screen texture draws, in my experience, on the G1 are pretty slow. I find you can get better performance by cutting it up and rendering it one at a time. I have a 512x1024 image I render as part of a parallax scrolling background for my game. I cut the source image up into 16 512x64 "strips", and just render the 5-6 (or 7-8 on WVGA screens) strips necessary to fill the screen up.
User avatar
mark@project8games.com
Developer
Developer
 
Posts: 41
Joined: Tue Mar 02, 2010 8:33 pm

Re: Help improving slow panning of big static drawing. Textu

Postby mesocyclone » Tue Oct 12, 2010 12:28 am

I mean vertices. It is scientific data that is represented best as a multicolor image. If I zoom in far enough, the individual triangles become interesting, and that would be a common usage pattern, but even at full zoom out the data presentation is useful. When zoomed in, the user would want to pan around in it by sliding a finger around the touch screen.

Because of the form the data comes in, the fastest and easiest way for me to render it is with OpenGL. Otherwise the algorithm to generate it is messy and I would probably have to spend a bunch of time coding C to make even the periodic generation fast enough, although that is one alternative (that I am trying to avoid).

Note also that I cannot pre-compute it before I distribute the application, because it does change over time (a few times an hour).

Although I am using a G1 now, I might be willing to target only 2.2 and above platforms, if that makes any difference.
mesocyclone
Freshman
Freshman
 
Posts: 2
Joined: Mon Oct 11, 2010 9:28 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 1 guest