My 3D project's performance problems

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

My 3D project's performance problems

Postby shredder » Tue Mar 04, 2008 2:40 pm

I am doing a 3D racing-game project. My 3D scene is really complex, and the emulator is too slow to encourage me from continuing.

In average, the scene render about 8000 polygons in 80 passes ( I called glDrawElements() 80 times to render them ). I use texture filtering GL_NEAREST, nicest perspective correction. I have pushed all vertices, indices, texture coords in buffer only once ( I used to rebuild them every frame, but it was far too slow ). The same thing written in C++ for Ngage was very fast.

The result frame rate is disappointingly 6-9 fps on emulator, running on a Dual Core 2x2.8Ghz, 1Gb RAM, GeForce 7300 GT 256Mb.

I suspect that because the emulator also emulates Linux, performance is bad. But I am not sure about it.

I am just wondering if there is a way to render 8000 triangles in 80 passes quickly in Android, or it is just the limit for the system. I also wonder if the emulator is truly slow, or there is some way to tweak it. And lastly, I wonder how fast will the real hardware be.

Please help.

Thanks in advance.
shredder
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Mar 03, 2008 2:34 pm

Top

Postby plusminus » Tue Mar 04, 2008 7:47 pm

Hello shredder,

Quake can be run at 30 FPS on an actual device, so there is possibly much still improvable.
Video: http://www.anddev.org/hands-on_another_ ... t1117.html

To your hardware:
  1. The emulator does not take advantage of your second Core.
  2. The graphic-card is very probabyl not used at all. (even cutting edge virtualization-apps have big problems using/utilizing teh graphics card. And here we have emulation!)
  3. I know almost nothing about OpenGL :roll:


The performance depends highly on your system-setup (but not just on MHz).
One of the developers responsible for the emulator is using a macbook pro which seems to be running a lot faster than my machine (1,6GHz TurionX2)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby shredder » Wed Mar 05, 2008 2:08 pm

:) Your reply is appreciated.

I did find a similar question on google's forum, and it says the same thing. Your reply confirms the issue further. And it makes me feel positive on my project.

However, it seems that I cannot rely on emulator any more for such a CPU consuming project. I wonder if there is an Android's emulator that takes advantage of 3D hardware rendering. Or if there will be.

A technique to get through this is to make a secondary project to run the game on PC in order to debug game logic. This is used in another project in my company, but it was much easier then this one. :cry: I am planning on using JOGL in Java AWT. Any better idea is much appreciated.
shredder
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Mar 03, 2008 2:34 pm

Postby eugenk » Sat Mar 08, 2008 12:47 am

Hi shredder ! I have the same problem with much less complex application. It have about 3000 non textured triangles as maximum. But look on emulator sources http://code.google.com/p/android/downloads/list. It not supports computer graphical hardware and not emulates real graphical hardware. All OpenGL calculations performs as usual ARM instructions flow, emulated with qemu. So hardware acceleration is ZERO, and all CPU instruction performs with emulator. I wondered that it is possible to work with OpenGL at all :)
About performance improvement. I use the next trick. Divide rendered scene by animated and not animated parts. Save not animated as Android native texture, when it rendered one time. When not rendered part will be changed, add it changes to Android texture. This allows to achieve about 30 FPS with seldom slow downs (m3-37a, Windows XP, Athlon 64 3000, 1GB RAM, GeForce 6200 128MB). Unfortunately resulting code is very complex, confused and hard for understanding and debugging.
eugenk
Developer
Developer
 
Posts: 29
Joined: Wed Jan 30, 2008 8:07 pm
Location: Russian Federation, Moscow

Postby benny! » Sat Mar 08, 2008 11:02 am

@eugenk:

Thanks for the hint. Sounds cool concerning performance
but confusing concerning source managing (as you already
say).

Wonder if you can emulate OpenGl hardware acceleration
in future ? Does anyone know how it works on other emu-
lators ?
User avatar
benny!
Experienced Developer
Experienced Developer
 
Posts: 69
Joined: Tue Nov 27, 2007 3:36 pm
Location: end of www

Postby eugenk » Sat Mar 08, 2008 12:31 pm

benny! wrote:@eugenk:
Wonder if you can emulate OpenGl hardware acceleration
in future ? Does anyone know how it works on other emu-
lators ?


No I think. OpenGL hardware will never be emulated. The reason - Android is not a concrete hardware. It is some software platform for various mobile phones, PDAs etc. So we can say something certain, only about CPU. It will be ARM, or maybe MIPS. And MIPS probability is very small. But we cannot say anything about graphical hardware. There is not any graphical hardware standards for mobile platforms. So OpenGL release in emulator we can consider as the worst case. And if your application will work on emulator with satisfactory performance, it is guaranteed, that it will works on real hardware. But I very want to have a developers version of real GooglePhone :)

About other emulators. I never hear about them.
eugenk
Developer
Developer
 
Posts: 29
Joined: Wed Jan 30, 2008 8:07 pm
Location: Russian Federation, Moscow

Top

Postby benny! » Sat Mar 08, 2008 12:50 pm

eugenk wrote:... But I very want to have a developers version of real GooglePhone :)

...


Yeah. Me too ;-)
User avatar
benny!
Experienced Developer
Experienced Developer
 
Posts: 69
Joined: Tue Nov 27, 2007 3:36 pm
Location: end of www

Postby shredder » Sun Mar 09, 2008 2:46 am

:lol: Actually, it was quite my fault to get the scene over-complexed. However, after analysing further, I was able to get the game up to 10fps, quite reasonable for a worst case, though the company is targeting high-end phones. :roll: Anyway, if physics, collison, and enemies are added, it will be another story.

The NGage team, developing the same game, had a worse nightmare: at the development time, they had no emulator for the targeted device ( :shock: ), and they had to develop a PC version beforehand.

I still have faith in developing a PC version besided the Android one.
shredder
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Mar 03, 2008 2:34 pm

Postby eugenk » Sun Mar 09, 2008 11:07 am

shredder, actually you need a developer's version of real hardware, I think. Hope that such hardwired SDKs will be available soon. I very want to have it and think that it need for every serious developer. It is practically impossible to evaluate real application performance, using emulator. I cannot to do it at any case :( So, now I have extremely complicated Java-code, using glReadPixel() (this is not recommended in OpenGL programming at all), and must spend DAYS (!!!!!) to it debugging :( If this were so I can evaluate real application performance, I'll can to do in 2-3 hours a job, which I do in a week now :(
eugenk
Developer
Developer
 
Posts: 29
Joined: Wed Jan 30, 2008 8:07 pm
Location: Russian Federation, Moscow

Postby Jitendra Kumar » Thu May 22, 2008 8:36 am

Hello Friend..........Do u have any idea of loading a 3ds model in Android.............I have a 3ds model but either i need to implement a 3ds loader for android or need to find out is there any loader available in Android or not.........I got that in android.graphics.glutilis there is a Object3D class.........how it will work ....no documentation is given in Tutorial...If get anything regarding this .............plz help.
Someday Someway Together We Would Be Baby
Jitendra Kumar
Developer
Developer
 
Posts: 49
Joined: Thu Mar 06, 2008 7:55 am
Location: Bangalore

Top

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

Who is online

Users browsing this forum: No registered users and 2 guests