Author Topic: State of OpenGL ES2.0 support  (Read 20674 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
State of OpenGL ES2.0 support
« on: May 13, 2011, 11:17:08 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...
« Last Edit: May 16, 2011, 12:12:30 am by EgonOlsen »

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Version updates!
« Reply #1 on: May 14, 2011, 02:57:02 pm »
I look forward to further information and news :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #2 on: May 16, 2011, 12:13:24 am »
I splitted the new version topic into this thread. It's about the current state of OpenGL ES2.0 support due to popular demand.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #3 on: May 16, 2011, 12:18:56 am »
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... ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #4 on: May 16, 2011, 10:37:00 pm »
An update: Ambient color and additional color as well as transparency and blitting seem to work fine now...

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: State of OpenGL ES2.0 support
« Reply #5 on: May 18, 2011, 07:49:07 pm »
I hope that I will see some public beta version in near future :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #6 on: May 20, 2011, 08:46:39 pm »
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...

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: State of OpenGL ES2.0 support
« Reply #7 on: May 20, 2011, 09:44:42 pm »
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? :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #8 on: May 21, 2011, 12:28:14 am »
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...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #9 on: May 25, 2011, 12:32:48 am »
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...

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: State of OpenGL ES2.0 support
« Reply #10 on: May 25, 2011, 11:34:14 am »
So spot light is not good for performance?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #11 on: May 25, 2011, 01:37:20 pm »
Not per pixel at least...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #12 on: May 25, 2011, 02:38:49 pm »
Lighting seems to work fine so far...


« Last Edit: May 25, 2011, 11:09:42 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #13 on: May 25, 2011, 11:09:30 pm »
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:


« Last Edit: May 25, 2011, 11:15:14 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: State of OpenGL ES2.0 support
« Reply #14 on: May 25, 2011, 11:45:10 pm »
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.
« Last Edit: May 25, 2011, 11:47:17 pm by EgonOlsen »