Issue with Android OpenGL Multisampling/Antialiasing

↘锁芯ラ 提交于 2019-12-05 22:44:20
Mārtiņš Možeiko

If you have not requested multisampling on EGL context, you can not turn it on with just the GL functions. See here how to do that:

user3319091

You can enable multisampling esay on c++ (android ndk)
If you can not programing with c++ srry.

  1. Install android-ndk (my android ndk version is r8b)
  2. Open android-ndk-r8b/samples/android-native-egl-example/jni/renderer.cpp
  3. Change add to includes EGL/egl.h GLES/gl.h GLES2/gl2.h GLES2/gl2ext.h files
  4. in bool Renderer::initialize() function :

change

   const EGLint attribs to {
                EGL_RED_SIZE, 5,  
                EGL_GREEN_SIZE, 6,  
                EGL_BLUE_SIZE, 5,  
                EGL_DEPTH_SIZE, 16,  
                // Requires that setEGLContextClientVersion(2) is called on the view.
                EGL_RENDERABLE_TYPE, 4 /* EGL_OPENGL_ES2_BIT */,
                EGL_SAMPLE_BUFFERS, 1 /* true */,
                EGL_SAMPLES, 2,
                EGL_NONE  };

EGL_SAMPLES is important this arg change number of sample

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!