Bad FPS for smaller size (OpenGL ES with SDL)

| | August 6, 2015

If you saw my other question, well, there is still a little problem:

Click here to watch on youtube

Basically, the frame rate is very bad on the actual device, where for some reason the animation is scaled (it looks like the left side on the video). It is quite fast on the simulator where it is not scaled (right side).

For a test, I submitted this new changeset that simply hard-codes the smaller size (in SDL_CreateWindow() and in glViewport()), and as you see in the video, now it is slow even in the simulator (left side shows the small size, right side shows the original size — otherwise the code is the same).

I’m clueless why it’s soooo slow with a smaller galaxy, in fact it should be FASTER.

The question is not about general speed optimization like reducing screen resolution or joining glBegin(GL_POINTS)/glEnd() blocks.

Update: For a test, I simply reduced the screen size to 320×480 and compiled it to OS X desktop — got the same speed as with 800×800, so this size-specific slow-down is on iOS only. Will post this on the SDL mailing list now.

One Response to “Bad FPS for smaller size (OpenGL ES with SDL)”

  1. Comparing iOS Simulator and OSX OpenGL speed is pointless. OpenGL ES on iOS Simulator is a software renderer, and OpenGL in OSX is GPU accelerated. The performance characteristics can thus be expected to be completely different.

    More to the point, the faster image with the galaxy on the right side of the screen culls more than half of the points against the view frustum. That is a very fast operation and already there you should get 2x performance. Further, the amount of overdraw in the centered galaxy is far higher since you have a smaller galaxy with the same point size as the larger galaxy to the right. Each overdraw increase blending computations. You see that as the brightness increasing.

    In short, you have 2x shading work and much more blending work. To remedy this, decrease the point size for the centered galaxy. You may also want to cut the number of points in half for the centered galaxy to get equal performance.

Leave a Reply