PDA

View Full Version : drawing antialiased line on OpenGL ES 2



guihazan
10-24-2012, 07:57 AM
Hi,

As the topic says, i want to draw an antialiased line on OpenGL ES 2. Note that the glHint only accepts GL_GENERATE_MIPMAP_HINT in GLES2.

Any help is greatly appreciated.

guich

dorbie
10-24-2012, 04:50 PM
Hint was only a quality setting where available.

AA lines are not supported in OpenGL ES 2.0 specification. If you are using OpenGL ES 1.0 or the SC variant then the API would be:

glEnable(GL_LINE_SMOOTH);

Be aware though that this only produces alpha fragments you must also enable GL_BLEND and set an appropriate glBlendFunc to see antialiased lines.


The alternative is to use multisample and not go with blended altialiased lines at all, but the edge quality will be lower.

tksuoran
10-25-2012, 05:00 AM
See if you can find multisample EGL config, or something similar if your platform does not use EGL.