Also split ghost karts out of additive shader, so fixed issues like
"drivers are facing backwards", "water in abyss affects ghost karts"
Todo: maybe transparency depend on current track color?
It was broken in commit 5cfed1bc1c.
We mix irr_driver->getVideoDriver()->setViewPort() and glViewport(...) functions and thus the first one, which is executed during camera activation, in some cases doesn't work. It compares the viewport to values which has been set last time and thinks that nothing changed.
It only happens on single player (with single camera), so we just restore the viewport to fullscreen after scene rendering to workaround the issue.
Actually the problem was that it was set after camera activation, which overwrote proper values.
I also fixed SSAO, RSM and normals vizualization in multiplayer games.
The problem is that textures with float internal formats can be used in framebuffers only when some extensions are available. This is a basic functionality and we need something that is supported on all drivers. As far as I tested, the basic integer GL_RGBA8 format works fine.
Another problem is with GL_BGRA format. The extension with GL_BGRA support is available for almost every device and irrlicht is able to load all textures from files (it has a fallback mode anyway), but when it's used as a texture for framebuffer, it produces a black screen. Again it works fine with GL_RGBA format.
The only issue that is not fixed is SSAO rendering. It uses linear depth rtt, which has GL_R32F type and which can't be easily changed to something other. I disabled SSAO for now, because it is too slow for embedded devices anyway.
I didn't change anything in original OpenGL 3.x rendering, so everything should work as before.
On desktop medium and high precision is generally the same, at least for mesa drivers. But on some Android devices medium precision is much worse, which causes artifacts. We need high precision float variables in vertex shaders for proper scene rendering. Setting different precision for fragment and vertex shaders seems to be not possible, so we just set it to high for both shader types when it's available.