BASIC

Author Topic: iPad 2D & 3D slow with GLB v8 beta  (Read 5845 times)

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
iPad 2D & 3D slow with GLB v8 beta
« on: 2010-Aug-20 »
Been having some fun with the new v8 beta while developing my latest game for the iPad. Howver, I've come across some serious speed issues with the iPad side of things :(

3D slowness

A simple 1500 poly object rotating around all 3 axis, one ambient light, one camera, basically the bear essentials. On the iPhone this runs at 60 fps solid, but change resolution to 1024x768 and install for iPad the framerate drops to 37.

2D slowness

I wouldn't say the 2D side is slow on the iPad but there is an issue when it comes to fullscreen goodness. Using polyvector only there appears to be no way to do 60 fps with a full resolution background and 20+ small sprites.

Using the same methods on the iPhone you are able to shunt around dozens and dozens of sprites (with polyvector) with a fullscreen image no problems.

I've tried splitting the background draw into 2, 4, 8, 16 quads but no drastic increase in speed. I have managed to get full screen with 10 sprites at 60 fps but that's the max limit before the fps drops.

My thoughts are the iPad has to draw a hell of a lot of data compared to the iPhone so for 2D is there anything that can be done to speed up fullscreen background drawing?

My main concern is the 3D side of things though. Has anyone else used the latest v8 beta with the iPad and found speed issues?

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #1 on: 2010-Aug-20 »
Indeed,

I got same problems moving Noid for iPhone to iPad (same code, bigger graphics, but double processor on iPad).

On iPhone got 60 fps constants; on Ipad only 40 fps :S.

Kinda Strange.

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1539
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #2 on: 2010-Aug-20 »
Let's hope the OpenGL ES Enhancements to OS4 for iPad will help also.  :bed:

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10661
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #3 on: 2010-Aug-20 »
iPad really gets slow when you're forced to render to a screen nd rotate tha then.
I think a call to glRotate of the projection matrix is a better idea. I'll post code when I find time.

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #4 on: 2010-Aug-21 »
That'll be great, Kitty, any speed boosting tips & code most appreciated  =D

I also found out tonight that the ipads GPU is the same as the iPhone 3GS which helps to explain a lot of speed issues considering the iPad has to fill 5x the amount of pixels for full screen.

With that I revisited my 3d code, set it for 30 fps and added some nice little time stepping code  :good: so now it runs very well at 30 fps and in busy busy scenes adjusts accordingly to keep things flowing well. I should of done this from the beginning but I expected the iPad to out perform the iPhone 3GS, which it does but I miss calculated the huge difference in pixel real-estate the iPad has to do. 

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2537
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #5 on: 2010-Aug-21 »
The iPad has a faster core and a 64 bit data bus for the SGX, it's quite a bit faster than the 3GS, when running raw OpenGL natively, even with the larger screen.

GLB seems to be running a little slow for me too on the iPad I am afraid.

Cheers,


Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #6 on: 2010-Aug-21 »
I might suggest something about the IPad slowness...

I've used GLBasic and now using Objective-C + Cocos2d on our games and in Cocos2D world, trying to have a one piece background image causes slow framerate on IPad as well. It seems this is related with the GPU's fill rate. The solution at there is to break the image into 4 pieces and than draw each of them at the appropriate positions to make the whole image drawn.

Don't know if it'll be helpfull but somebody might give it a try to let us all know? ;)

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #7 on: 2010-Aug-21 »
Quote
Don't know if it'll be helpfull but somebody might give it a try to let us all know?

Already tried that (see my 1st post) and found that (via polyvector) splitting it into 256x256 chunks worked quicker than 4 512x384 chunks which worked the best for those using cocos2d iPhone.

I hope there's some tweaking Kitty can come up with to aid in both 2D and 3D side of GLB  :good:

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #8 on: 2010-Aug-21 »
Perhaps problem with the dualcore support ?
Maybe only one core used ?
"Sugar makes the world go 'round. Caffeine makes it spin faster."

MrTAToad

  • Guest
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #9 on: 2010-Aug-21 »
Or perhaps rendering needs to be done slightly differently ?

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 929
  • KodeSource
    • View Profile
    • KodeSource
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #10 on: 2010-Aug-24 »
For the 2D, are you using only one tile texture file for all tiles?
Then also only using one initial STARTPOLY and one final ENDPOLY, and using POLYNEWSTRIP for each new tile?
This should get your draw calls down to one for the map, about as fast as you can get.
Maybe tighten up your map drawing routine/loop.

Just curious, do textures files of size power-of-two versus not power-of-two make any speed difference?  (ie: 512x512 versus 500x500)

And for the 3D, if you are using X_CULLMODE 0 (for 'both') try using '1' for front, or '-1' for back.
This may save some processing.

Just some random thoughts.

[Edit]
But still doesn't explain why the iPad is slower.
« Last Edit: 2010-Aug-24 by Slydog »
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Cartoonkicker

  • Mc. Print
  • *
  • Posts: 22
    • View Profile
    • www.cartOOnkicker.de
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #11 on: 2010-Sep-28 »
i have developed my game on/for iPod Touch 2G and it runs with >60 FPS. Last weekend i bought the new generation (4.) of the iPod Touch. I tried it with the same code and the same Resolution 480x320  (btw 960x640 isn't supported by GLBasic so far ;)) and i only got 18-20 FPS. there seems to be a problem with the new hardware.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1539
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #12 on: 2010-Sep-28 »
One of my games runs at 30-50fps on iPod Touch 3G (iOS 4.2) but 60fps on 4G (iOS4.1) and only 20fps on iPad (iOS4.2) but another game designed differently run 60fps on all.  :whistle:

Offline Cartoonkicker

  • Mc. Print
  • *
  • Posts: 22
    • View Profile
    • www.cartOOnkicker.de
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #13 on: 2010-Sep-28 »
Did you change something in the XCode-Options? May i have to change something there? i thought that my game would speed up on the new hardware (iOS4.1)

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 1004
    • View Profile
Re: iPad 2D & 3D slow with GLB v8 beta
« Reply #14 on: 2010-Sep-29 »
One of my games runs at 30-50fps on iPod Touch 3G (iOS 4.2) but 60fps on 4G (iOS4.1) and only 20fps on iPad (iOS4.2) but another game designed differently run 60fps on all.  :whistle:
So...the other game that was designed differently...you going to give away your secret?  :)