ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
711 stars 160 forks source link

Replacement for alpha/blend hacks used for xash3d #91

Open mittorn opened 5 years ago

mittorn commented 5 years ago

Not sure if actual now, but it should be faster than converting texture to RGB when application requests GL_RGB as internal format: https://github.com/FWGS/nanogl/blob/master/nanoWrap.cpp#L1278 This will fix blend errors for LIBGL_AVOID24BITS if still exist

ptitSeb commented 5 years ago

Yes, the alpha/blend issue is because the texture gain an alpha channel where it should not, thus changing the blend equation. All this should be fixed with gl4es now, especially with GLES2 backend. You this have some issues?

ptitSeb commented 5 years ago

Or do you mean I should force the alpha channel to 255 when internalformat is asked as GL_RGB but storing internally as GL_RGBA?

mittorn commented 5 years ago

Yes. Issue in xash3d was because texture was loaded wirh internalformat=GL_RGB, but it was forced to GL_RGBA keeping alpha channel. It seems that gl4es now converts texture, so it will be udeful only with LIBGL_AVOID24BITS option. I cannot check if it still exist because of buggy amdgpu-pro driver which crashes on gles2