State of OpenGL ES2.0 support

Started by EgonOlsen, May 13, 2011, 11:17:08 PM

Previous topic - Next topic

EgonOlsen

Quote from: Thomas. on May 11, 2011, 06:14:35 PM
What about the new version, any new info? :)
I had two evenings to spare and started working on it. My idea is to implement it in a way that it appears as ES 1.1 to the engine, so that jPCT's actual renderer needs no big changes and one codebase can serve both worlds. So far, it's working fine...but there's no support for anything else than one layer of opaque textures for now, no lighting, no fog, no nothing...

The test scene in all it's ES2.0 glory:



One bugger: Because of Google's stupidity http://code.google.com/p/android/issues/detail?id=8931, it doesn't work with anything below 2.3...at least not if you intend to use VBOs. I'm not sure what Dalvik does if methods are used in a compiled class that are never called, so maybe it'll work in 2.2 too but without VBOs...i'll care about that at a later time...

Thomas.

I look forward to further information and news :)

EgonOlsen

I splitted the new version topic into this thread. It's about the current state of OpenGL ES2.0 support due to popular demand.

EgonOlsen

It's now stable enough to run An3DBenchXL...it works fine, but it looks awful, because i'm still using my very basic default shader which supports virtually nothing but simple texturing.

Therefor, the benchmark results have to be taken with a grain of salt, because neither the fully featured shader nor the Java code for processing lights, fog and material are in place right now. It scored ~30000 points while the OpenGL ES1.1 version scores ~27500 points...but with much more gpu features used, so this will change. But at least it's not slower for now... ;)

EgonOlsen

An update: Ambient color and additional color as well as transparency and blitting seem to work fine now...

Thomas.

I hope that I will see some public beta version in near future :)

EgonOlsen

Will take some time. I still have to mimic OpenGL's lighting stuff in both Java and GLSL code for example. That's not that easy...

Thomas.

I know, that you have a lot of work, but will be here support for spotlights and shadows? will be the same as desktops jPCT? :)

EgonOlsen

My first goal is to make it behave like jPCT-AE when run on ES 1.x...that's difficult enough. Then, i'll open the shader support to anyone (just like desktop jPCT does, but maybe in a different way). What you do with the shaders...well, that's up to you. I'll open the default shader as well, so you are free to fiddle around with it. Concerning shadows, shaders alone don't cut it. You'll need to be able to render into the depth buffer...that's another story...

EgonOlsen

Shaders on mobile devices..LOL! I thought that it might be a good idea to implement some phong lighting instead of the fixed function pipeline's vertex lighting...not good. The per-pixel operations needed for this kill performance. With only four lights, you are down to one digit fps numbers on the Nexus S..back to good old gouraud shading, i guess...

Thomas.

So spot light is not good for performance?

EgonOlsen


EgonOlsen

#12
Lighting seems to work fine so far...



EgonOlsen

#13
Fog works fine, too. With that, everything works that is required to make Alien Runner look as it should when using OpenGL ES 2.0. This is it:



EgonOlsen

#14
Some performance figures taken from the Nexus S. These are from An3DBenchXL. The tests are all running fine, just the multi-texturing in the Ninja test isn't supported right now, so it will get worse...


Using the OpenGL ES 1.1 path:
Quote
05-25 23:29:24.995: INFO/jPCT-AE(6997): Double dragon: 30.55 fps
05-25 23:29:24.995: INFO/jPCT-AE(6997): Flower power: 22.86 fps
05-25 23:29:24.995: INFO/jPCT-AE(6997): Ninjas' garden: 16.14 fps
05-25 23:29:24.995: INFO/jPCT-AE(6997): Emperor's new clothes: 43.58 fps
05-25 23:29:24.995: INFO/jPCT-AE(6997): Magic island: 37.33 fps
05-25 23:29:24.995: INFO/jPCT-AE(6997): TOTAL SCORE: 26053

Using the OpenGL ES 2.0 path:
Quote
05-25 23:25:07.137: INFO/jPCT-AE(6940): Double dragon: 9.25 fps
05-25 23:25:07.137: INFO/jPCT-AE(6940): Flower power: 21.52 fps
05-25 23:25:07.137: INFO/jPCT-AE(6940): Ninjas' garden: 13.61 fps
05-25 23:25:07.137: INFO/jPCT-AE(6940): Emperor's new clothes: 42.26 fps
05-25 23:25:07.137: INFO/jPCT-AE(6940): Magic island: 19.59 fps
05-25 23:25:07.137: INFO/jPCT-AE(6940): TOTAL SCORE: 18394

Why is that? Well, as you can see, high polygon tests (dragon and island) suffer the most. I guess that's because a high polygon count means a high vertex count, which means a lot of calls to the vertex shader. The most expensive part of the vertex shader is the lighting, because it requires some dot-products, which seem to be slow. If you remove the light source from the tests, it runs much faster...

So..well...this is a bit disappointing, but i actually expected something like this. Too bad, that you can't mix shaders and fixed function as you can with desktop OpenGL.