The following quaternion calculated by shortestArcQuat in
rescue animation leads to nan in asinf:
0.710828841, -0.00974362344, -0.703500867, 0.00481829932
-2.0f * (X * Z - Y * W) equals 1.00004351 with above figures
With btAsin it will:
if (x<btScalar(-1)) x=btScalar(-1);
if (x>btScalar(1)) x=btScalar(1);
return asin(x);
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.