maxAttribs in AndroidEGLWindow

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

maxAttribs in AndroidEGLWindow

Post by c6burns » Wed Nov 13, 2013 2:09 am

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!
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: maxAttribs in AndroidEGLWindow

Post by c6burns » Wed Nov 13, 2013 9:58 am

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.
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: maxAttribs in AndroidEGLWindow

Post by c6burns » Thu Nov 14, 2013 3:18 am

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 628 times
0 x

Post Reply