I'm fairly new to OpenGL and to ES2.0. I have shared c++ opengl es2 code that i use to draw on ios and android(with ndk CMake)... it mostly works but now I need antialiasing and its kind of confusing, the solutions I'm seeing are platform dependent and android side is more confusing and has limitations. I have been searching for solutions but need some more clarity.
What should have worked on both: Apparently, the Kronos RenderBuffer description says
Renderbuffer objects also natively accommodate Multisampling (MSAA).
but es 2.0 doesn't seem to support this. iOS has its own method glRenderbufferStorageMultisampleAPPLE
that supports it on es 2.0 but android doesn't have it. Nor can android Blit the FrameBuffers while ios has own method(once again) glResolveMultisampleFramebufferAPPLE
to do that.
If this is done platform specific: iOS can do setDrawableMultisample:GLKViewDrawableMultisample4X
which seems to work. But android has limitations, there is EGLConfigChooser
's chooseConfig
to do it but I have read not all android devices support antialiasing like this(i also can't test it on the emulator), so I have to do it again in the native c++ code.
Other: I have been reading and there are some methods like drawing everything a lot of times in a circular (with more precision) or upscaling the whole view to 2x and drawing and then downscaling back to get more smoother lines... Another way I'm not sure if it works or not but drawing to a texture or image which somehow does the antialiasing or supports it (need a better understanding of this)
What I need now: My requirement is to only draw vertices with color (i do my stuff through this) using glDrawArrays
method. And everything that is drawn should be smooth or antialiased. How should I approach this? I need better references or tutorials where I can read properly about any method that should work on both. I don't mind the reading and learning but I'm kind of stuck with so many options and little context with them. EDIT: I'm drawing in 2D(z=0 always), there are no issues of depth.