It adds support for OpenGL ES renderer, which is needed for Android port and for running STK on other embedded devices such as Raspberry Pi.
Currently it works in two ways:
- Shader-based pipeline, which requires OpenGL ES 3.0 (Android >= 4.3)
- Fallback to irrlicht-based fixed pipeline that needs OpenGL ES 2.0. The fixed pipeline generally works, but it is affected by the same issues as our OpenGL 2.1 fixed pipeline renderer.
I tried to modify our OpenGL renderer as little as possible to avoid regressions. The only one major change is that we are now using the "#stk_include" directive in shaders instead of linking multiple shaders into one program.
Currently it works only on linux. The Android port needs some refactoring. In theory it should be possible to make it working on Windows, but we would need some OpenGL ES SDK, or maybe modified libglew.
At this stage it is playable with current mesa drivers. I tested it on intel graphics card and I didn't notice any issues.
On Android only the OpenGL ES 2.0 renderer with fixed pipeline has been tested for now.
In ssao.frag we are computing theta valaue and it looks that intel driver doesn't like too big values for sinus and cosinus computations.
I just used modulo 360 to store lower angle values in theta variable.
The check for GL_ARB_geometry_shader4 doesn't have sense at all because we don't use this extension and our geometry shaders use functionality which is available in core OpenGL 3.2.
The reason that it wasn't working for older mesa versions must be a bug in mesa or maybe missing other functionality (but not GL_ARB_geometry_shader4).
I checked it with mesa 11.2 and current git version and it works fine on intel, nouveau and with software rendering.
It needs some testing because it potentially affects all drivers with OpenGL >= 3.2 on every platform.
If someone could test it with Radeon drivers, I would be really happy to enable it in upcoming release, at least on linux.
The problem was with shader-based pipeline with disabled "advanced effects" in options.
In this case we don't use RTTs and gl_FragCoord contains values in range of whole window. So fo 2 players we still get gl_FragCoord.y = 0..window_size instead of gl_FragCoord.y = 0..window_size/2.
The easiest way to solve it seems to be modulo it by current viewport size. It should be compatible with advanced pipeline as well as single-player games.
Atm. I'm not sure if this should be applied to 0.9.2 branch. It should work fine, but needs some testing.
- Increase version for sRGB-capable visual workaround because it doesn't look that it will be fixed anytime soon
- Enable compute shaders because it works fine now
- Enable texture compression because it works now too.
Texture compression for intel should work fine also for older versions, but it's hard to say which one version is the first working one.
It was reporting an error:
[error ] GLWrap: Error in shader gaussian6h.comp
[error ] GLWrap: 0:77(1): error: storage qualifiers must come after precise, invariant, interpolation, layout and auxiliary storage qualifiers