Page 1 of 1

maxAttribs in AndroidEGLWindow

Posted: Wed Nov 13, 2013 2:09 am
by c6burns
Would love to submit a few patches, such as MSAA and CSAA support, but there is one thing I don't I understand about the GLES2 RenderSystem, specifically AndroidEGLWindow.

In EGLSupport::selectGLConfig ... only the minAttribs are passed to EGLSupport::chooseGLConfig where the actual call to eglChooseConfig is made. Afterwards, the maxAttribs are iterated using the GLConfigAttribs helper class. As far as I understand, this class just makes some eglGetConfigAttrib calls in its load method. The end result is that the minAttribs are the ones chosen by EGL, and some devices will end up rendering in 16 bit color. For a while I just hardcoded EGL_BUFFER_SIZE and was fine with it, but now I'm introducing more attribs (like EGL_SAMPLE_BUFFERS, EGL_SAMPLES, etc) and I end up sticking them in minAttribs, but I'm wondering if there's something I'm missing or just completely misunderstanding about maxAttribs?

Thanks for your time!

Re: maxAttribs in AndroidEGLWindow

Posted: Wed Nov 13, 2013 9:58 am
by c6burns
JIRA: https://ogre3d.atlassian.net/browse/OGRE-333
Pull request: https://bitbucket.org/sinbad/ogre/pull- ... ption/diff

That should solve the color buffer size issue. I'll add MSAA/CSAA next if this is approved, but the way it has to work is by trying to set CSAA first and catching the resulting exception if it fails. This is because of the way EGLSupport::chooseGLConfig works, which I don't want to mess with, and also at that point there's no context so we can't check GL_RENDERER/GL_VENDOR. If it does fail, it falls back to MSAA. If that fails it falls back to default attribs.

Re: maxAttribs in AndroidEGLWindow

Posted: Thu Nov 14, 2013 3:18 am
by c6burns
CSAA/MSAA pull request: https://bitbucket.org/sinbad/ogre/pull- ... pport/diff

Results of anti aliasing are not bad. In the screen below, no AA on the left, CSAA in the middle, and MSAAx4 on the right.
MSAA.png
MSAA.png (128.25 KiB) Viewed 1290 times