I'm currently working on an OpenGL ES 1.1 app for the iPad
its running at full 768x1024 iPad resolution, with textures, polygons, and the works
but only at about 30 fps! (not fast enough for my purposes)
im pretty sure its not my code, because when i lowered the resolution, the FPS increased, eventually the normal 60 at iPod touch resoultion
Is anyone else encountering this FPS slowdown?
should I reduce the size then scale up?... also, would upgrading to opengl 2.0 increase speed?
any guidance is much appreciated!
The iPad has the exact same GPU as the iPhone 3GS, so you would probably expect worse fullscreen performance on the iPad due to having to push 5 times as many pixels.
If this is the case, then using scaling is probably the best solution. After all, even console developers have to do it!
I had same problem when porting an iPhone game to iPad. There are few optimizations that raised FPS from 5-6 to 20+:
using vbo-s
reducing as much as possible per fragment operations(fog, blend, multi-texturing)
putting some operations on CPU(lights for example)
using multi-texturing instead of multi-pass with blend
improving culling algorithm(now we have a better CPU)
Related
iPad Pro simulators are so slow that they become practically useless when running my cocos2dx game. Theoretical FPS displayed is 60, but all animations take minutes instead of seconds (e.g. 30 seconds instead of a fraction of a second).
I made sure 100 times that Slow Animations are turned off on my simulator.
I've found this topic: iOS Simulator games run very slow (low fps) where the reasons for possible poor simulator performance are explained, but:
First, I can't deduce HOW slow their simulators are (they complain about bad FPS, my theoretical fps is good (???)). I'm getting the impression that they are able to test something while I am not
Second, I need a solution to this problem as I need to test my stuff on an ipad pro 12.9 inch and I don't have the funds to buy one for tests now :) . However, I am thinking on getting a better macbook.
I am using Macbook Air 2014 with 4GB RAM. Do you think this might be the reason? Can anyone tell me whether they are using ipad pro simulators when testing their games (Cocos, Unity, SpriteKit?), and if you get decent speed, then what are your Mac specs that might affect performance (processor, RAM?)
The simulator is not a device and it's performance varies depending on the machine you're running it on, but also the type of device you're simulating.
The iPad Pro devices are both large and have a retina display. The simulator has to process 2732 x 2048 (12.9" 5.6M pixels) and 2048 x 1536 (9.7" 3M pixels). The iPhone 6/6plus and later models have similarly high pixel counts. This takes a lot of CPU+GPU power to render all those pixels.
Your Macbook Air is decent, but it's screen has a much smaller resolution than the simulator and its GPU was chosen with its smaller screen-size in mind. The integrated intel graphics aren't that performant.
If you can test out running the same game/app as a Mac application instead you should see better performance.
My advice:
Use 30fps during daily testing (or when in debug mode) director->setAnimationInterval(1.f/30.f);, if your game requires 60fps for its gameplay then you may want to look into other options.
You can also add one of the non-retina iPad simulators for testing. iPad Mini or iPad 2. Test on the Pro simulators periodically only to check for any positioning/scaling issues.
Render to a small(er) frame buffer and then render the frame buffer scaled up into the final screen buffer.
It is always recommended to get an actual device when doing mobile development as the simulators/emulators don't provide real world performance characteristics.
Even though it's not what you're asking I'd still repeat the key point in the linked answer: Only worry about performance when running on an actual device, and find a way to not have it affect.
I have an app based on "OpenGL Game" Xcode template, for everyday testing/dev I would like to render full screen but at lower resolution in simulator (e.g. 1/2 or 1/4). Any efficient/savvy way to put this in place?
(in case anybody wonder, I want to do this because my app is running very slow in simulator, so rendering at a smaller resolution would make testing/debugging a lot more programmer-friendly)
The contentScaleFactor of the view is 2.0 by default on a Retina display. If you reduce the scale factor, GLKView automatically uses a smaller framebuffer and scales its contents up to screen size for display.
Scale factor 1.0 is half size (or the same number of pixels as a non-Retina screen). 0.5 would be quarter size — big, chunky pixels on any display. Non-integral scale factors between 1.0 and 2.0 work, too, and can be a great way to compromise between quality and performance on a Retina display.
Update: just had a vote remind me of this answer. I'm surprised I wouldn't have said this originally, but I may as well add it now...
The iOS Simulator runs OpenGL ES using a software renderer (i.e. on the host Mac's CPU, not its GPU). That's why it's slow. Performance characteristics and rendering results can vary from renderer to renderer, so never trust the simulator for anything OpenGL/GPU-related (except perhaps in very broad strokes).
I've been experimenting with createjs to convert some flash as3 animations to HTML5. everything works fine in desktop browsers, but on an i-pad the animation are considerably slower. Where there are complex vector objects they are so slow as to be unusable. I can speed things up by caching the objects, but the quality of the resulting graphics is poor. Are there any solutions to this problem?
Thanks in advance
Pete
take a look on canvas size. after a centain size the mobile vídeo boards cannot accelerate the graphics like pc does.
Tip #4. Watch The Size of Your Canvas
Obviously, the larger the canvas the more costly the drawing
operation, but if you’re targeting mobile devices, there are some size
limits you must keep in mind.
From Safari Web Content Guide:
The maximum size for a canvas element is 3 megapixels for devices with
less than 256 MB RAM and 5 megapixels for devices with greater or
equal than 256 MB RAM
So if you want to support Apple’s older hardware, the size of your
canvas cannot exceed 2048×1464.
But that’s not all! Even with smaller sizes, you have to keep your
canvas’s aspect ratio between ~3/4 and ~4/3. If you step outside those
boundaries, webkit seems to switch to a totally different rendering
mode splitting the canvas into multiple fixed-size areas and rendering
them separately with a noticeable delay between them.
There doesn’t seem to be any documentation on this but I have
confirmed this happens on both Chrome and Safari on iOS versions 6.0.1
and 5.1.1.
source http://blog.toggl.com/2013/05/6-performance-tips-for-html-canvas-and-createjs/
I've been working on an iPad app that has gone through fairly extensive testing on the iPad 2. I recently obtained a "New iPad" (iPad 3), and the app feels significantly slower. Animations / scolling behaviors that were silky smooth in the iPad 2 now feel extremely stuttery on the new iPad.
I do a lot of the standard UI performance tips: using shadowPaths, drawing UITableViewCells using CoreGraphics, rasterizing views that don't change often / don't need to animate.
Are there any pitfalls I should watch be watching out for in transitioning my app to the iPad 3?
Update
I swore that I tried this before but removing rounded corners from my UIViews views ended up speeding the app significantly. clipToBounds also seems to be a significant performance hit (although strangely... setting a view's layer's maskToBounds seems to be okay, which makes no sense to me). Some combination of this and other tweaks seems to have resolved the issue.
Once I do a second visual pass over the app, I'll figure out a way to reimplement rounded corners in a more performant way.
4x the pixels, only 2x the fill rate. The maths says it all.
I think that the biggest thing to watch out for is copies of graphics from system memory to the video card since they are 4X larger than previous iPad graphics with about the same CPU power as the iPad 2.
Maybe it's due to upscaling by iOS? After all it has to calculate a higher res version of everything before showing to screen. Since some things on the screen are hi-res already (font and default ui elements) it has to scale every other element individually.
Have you tried just scaling the images yourself and adding them as retina images to your project?
Good luck.
My app needs to run different code (larger textures) on iPad 2. How should I programmatically detect faster graphics hardware?
The code should be future-proof (i.e. it would detect faster graphics hardware on iPad 3 or any other future iOS devices that have it).
Maybe you can just go with the framerate, if it drops too much, go for the smaller textures, if it is way above 100 fps, take the bigger ones.