简体   繁体   中英

opengl: How to do anti-aliasing for triangle

I'm learning OpenGL using Visual Studio C++. Just wondering how I go about doing anti-alias techniques for when I do glBegin(GL_Triangles)... it doesn't seem like a primitive type, or am I wrong?

Though its not specific what level of antialiasing you are expecting. If you are using glut you can definitely try following code.

glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE);
glEnable(GL_MULTISAMPLE);

This will give you multi sampling anti aliasing. From what code you have given you are not doing anything in programmable mode or modern opengl so I think that should be sufficient to you as you dont have to do anything extra.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM