Hello,
I wanted to make antialiasing for some of my scenes…I am actually using GL_MAP2_VERTEX_3, please see the code below.
glPushMatrix( );
/* Translate to the Position */
glTranslated( X , Y , Z );
/* Rotation of the position */
glRotatef( Angle , X_R , Y_R , Z_R );
/* Translucency */
glEnable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable ( GL_LINE_SMOOTH);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
/* Color of polygon inside */
glColor4f( fR , fG , fB , Alpha );
/* draw the surface */
glEnable(GL_DEPTH_TEST);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 5 , 0, 1, 15 , 2 , ArrayofPoints);
glEnable(GL_MAP2_VERTEX_3);
glEnable(GL_AUTO_NORMAL);
glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0);
glEvalMesh2(GL_LINE, 0, 20, 0, 20 );
glEvalMesh2(GL_FILL, 0, 20, 0, 20 );
glDisable(GL_DEPTH_TEST );
glDisable(GL_MAP2_VERTEX_3);
glDisable(GL_AUTO_NORMAL);
// Disable Alpha Channel
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
glPopMatrix();
When i use line smooth and pass GL_Line to EvalMesh i.e
Gl::glEvalMesh2(Gl::GL_LINE, 0, 20, 0, 20 );
then i am able to achieve antialiasing but I also need transperency during few cases, which is not working when I antialias. But without antialiasing this transperency is working.
Can anyone help me out in this regard?? I need to preserve this transperency affect even if i use Antialiasing tecniques.
Please also let me know if there is any other way to do achive both antialiasing and transperency in this scenario.