

There is a constant EGL14.EGL_MULTISAMPLE_RESOLVE but as far I know, that can be used only to query rather than to set, the surface's multisample strategy, and neither of the two possible values mean "off". GlDisable(GL_MULTISAMPLING) doesn't work on Android because the constant GL_MULTISAMPLING is not defined in either GLES20 nor GLES30. (The extra time for the occasional render pass on my main render surface is small enough to be okay). If possible, I'd like to avoid creating another (off-screen) render context without multisampling because it's extra work to manage its lifecycle and to communicate between the two threads.

In Android's developer options, I read back values completely out of the range that I've rendered, which for some reason doesn't happen otherwise on my multisampling surface. We also cover how to handle various Android events in a native program. From now on, we'll use GL as a shorthand for OpenGL ES 2.0. For 3D graphics, there are other tutorials available, as well as the NativeGlobe example provided in CodeWorks for Android.

(How) can I temporarily turn off multisampling for this render context?įor example, I sometimes use the same render surface between frames to render my scene in flat fake colors for a picking feature, in which case multisampling it as least unnecessary. In this section, we only cover 2D graphics using OpenGL ES 2.0. In my OpenGL ES 2.0 Android app, I render to an EGL surface with >= 2 samples I obtain this surface by passing:Īs part of the attribute_list argument for egl.eglChooseconfig() in my GLSurfaceView.EGLConfigChooser. By enabling 'Force 4x MSAA,' you can force all games and apps using OpenGL ES 2.0 or higher to use the technique to improve the image.
