heximal
heximal

Reputation: 10517

OpenGL ES antialiasing again

I draw 3d-scene with primitives like this:

glLoadIdentity();

glColor4f(model[i][8], model[i][9], model[i][10], 1.0);
glTranslatef(current_x, current_y, current_z);


glVertexPointer(3, GL_FLOAT, 0, &squareVertices[0]);
glEnableClientState(GL_VERTEX_ARRAY);
glShadeModel(GL_FLAT);

glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

and of course there is no antialiasing. i've read and tried much advices (including stackoverflow). e.g.:

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);

but still can't implement aa-technique. can anybody tell me, is it possible without modifying a lot of existing code?

Upvotes: 2

Views: 6234

Answers (1)

Beaker
Beaker

Reputation: 1608

You are using GL_LINE_SMOOTH on a GL_TRIANGLE_STRIP. iOS doesn't support line smoothing and more importantly can only be used on lines. Are you enabling blending BEFORE you draw?

This is a good question about the same issue.

The best method is to use a texture with a blurred edge (alpha) and apply it to your triangles. This will create a line smoothing effect.

This can be seen here.

Upvotes: 1

Related Questions