Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I make line or polygon antialiasing work?

antialiasing line polygon
0
Posted

How can I make line or polygon antialiasing work?

0

To render smooth (antialiased) lines, an application needs to do the following: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); If the scene consists entirely of smooth lines, you need to disable the depth test or set it to GL_ALWAYS. If a scene contains both smooth lines and other primitives, turning depth test off isn’t an option. You can achieve nearly correct rendering results if you treat the smooth lines as transparent primitives. The other (non-blended) primitives should be rendered first, then the smooth lines rendered last, in back to front order. See the transparency section for more information. Even taking these precautions might not prevent some rasterization artifacts at the joints of smooth line segments that share common vertices. The fact that the depth test is enabled could conceivably cause some line endpoints to be rendered incorrectly. This is a rendering artifact that you may have to live with if the depth test must

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123