OpenGL es 2.0 performance

Hi there, has anyone with the unity 3 beta managed to build an iPad project with open gl es 2 and compared the performance to the same build with the old unity 1.7?

I was wondering if we are likely to get any performance gains from iPad / 3GS only build targets using the new open gl es 2 support?

Cheers guys, pre ordering my unity 3 licenses today :slight_smile: all the new stuff looks fantastic.

Words seems to be exactly the opposite; it’s a better idea to stick with OGLES 1.1.

To get better performance from es2.0 than from es1.1 you need to be advanced to a master in shaders to optimize it to that point. in all other cases es 1.1 will outperform you. Especially due to the fact that the gpu fillrate is insufficient technically for ipad / iphone 4 resolutions, so you have to opt the shader to resolve that. in those cases you can actually surpass es 1.1 as a few cases have shown. But those cases are high profile games with teams of pros, not indies with medium to no background.

Any chance that OpenGL ES 2.0 implementation will be a bit more optimized in the final version of unity3? So far I’ve seen it’s 50% slower.
Have I correctly understood that 2.0 is completely different from 1.x and that even the most primitive stuff currently runs slower?

OGL ES 2.0 is completely different, right. Its pure shader, there is no rendering path without shaders anymore and you can’t mix ES 1.1 and ES 2.0 at all.

That being said, I think the ES 2.0 path hasn’t optimized shaders yet (actually U3 iphone has very few shaders at the time, the old ones are not opted for ES 2.0 usage in any way and the U3 desktop ones are horribly anti optimized as the surface shader stuff leads to shaders that are far more sophisticated than you want them to be etc. For best performance, you would write your shaders in GLSL (for ES 2.0), then you don’t have to cope with cg faking functionality otherwise not available on ES 2.0 through complicated functions. You know what you ahve and what you can use.
As long as you rely on automagic and the full cg available stuff, I doubt you will see performance that outperforms the ES 1.1 stuff

Just a little “correction”: we are working really hard on both optimizing GLSL generation (looking promising right now) and optimizing GLES2.0 internals.
So while everything said so far is correct - we are showing some love to those of you who are not techy enough to write really optimized shaders themselves :wink:

Didn’t want to imply anything else :slight_smile:

UT has done some great work there, especially with keeping the simplicity of the desktop side working on the iDevice side and I’m looking forward to the performance post optimization of shaders and some things and once batching is fully working again.
Its already now faster than U 1.7 :slight_smile:

From what I’ve seen so far, 2.0 performance isn’t that bad, but yes, you need to write the shaders yourself. Which for the average case, isn’t that hard, since there are tons of examples on the internet.

Also, comparing 1.1 to 2.0 is a bit of weird comparison. How do fragment shaders perform on 1.1? They don’t perform at all.

As far as the GPU’s being underpowered, that’s not really the case. The fill rate is an issue, but the iPad isn’t the first gaming platform with fill rate issues. As long as you have discipline with things like particle effects, there is plenty of room to make a really nice looking game. For a portable system, the iPad currently has the best performance out of any platform that’s out there.

but the ipad is the first device, together with the iphone 4, where the appropriate gpu to avoid the problem existed and was just ignored (SGX 540 was available long enough, not counting the SGX 545 which has been available since last autumn / winter too, both of them having the required fillrate to compensate for the resolution)

in the end quote some can be overcome, thats where OGL ES 2.0 and optimized shaders come in

Although slightly off topic, here’s some things I’ve noticed about iPad performance, for anyone who is interested -

  1. Draw calls are still expensive, just not as bad as on the 3G. My game currently runs at a constant 60fps, when I reach about 35 drawcalls the frame rate starts dipping. I’m reasonably sure this is due to the drawcalls, since this is due to a bug with the dynamic batching, and the only thing I’m adding is cubes.

  2. Particles are prohibitively expensive. Forget about making an explosion with tons of particles The method I’ve been using, is to prerender explosions to an animated texture, using a program like Particle illusion. I then prerender sparks to another animated texture, and then have a blast wave texture. To get the explosions to feel dynamic, I turned on random rotation in the emitter for each animated texture, which causes them to spawn at different rotations every time. This actually ends up looking better than explosions made completely out of particles, and each explosion has a particle emit count of 3.

  3. The fill rate of the iPad isn’t actually that bad, but doing a fragment shader for an object that fills up a large part of the screen can cause the framerate to drop quite a bit if it is doing non-trivial math. To get around this, I render at a much lower resolution off screen, then apply the render texture to the large object.

About 2-3 times the whole screen per frame can depending on the requirements be seriously bad if you do a 2D game (in a 3d it is not half as bad) …
but you can resort to use optimized mesh hulls to “cut the alpha through mesh nonpresence” but doing so is a time intensive thing

OpenGL ES 2.0 is probably a bit more tricky, but definatly always the better choice for iPhone 3GS and newer. The graphic chip built into those devices doesn´t have a fixed function pipeline anymore, instead the fixed function pipeline, when using OpenGL ES 1.1 on those devices, gets emulated with shaders.

Edit: Sorry for digging it up. I saw 16th, but not that the thread is already a month old ;).