• Advertisement
Sign in to follow this  

Antialiasing Blending Problem

This topic is 4468 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As you can see, the anti-aliasing does not blend to the color currently filled within each polygon, but rather blends to the color behind it... why is this so?

Share this post


Link to post
Share on other sites
Advertisement
This is a shot in the dark but you may be suffering from z-fighting. There's a section of it in the forum FAQ.

I can't really help you without seeing your blending code.

Share this post


Link to post
Share on other sites
There's really not much code to see:


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

glEnable(GL_LINE_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);

glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);

Share this post


Link to post
Share on other sites
The results you are seeing are entirely correct for polygon smoothing. To quote the glEnable man page:

Quote:
If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. For correct anti-aliased polygons, an alpha buffer is needed and the polygons must be sorted front to back.


It blends to the green background color, because the edges of the polygon are blended with the current contents of the framebuffer. What you want to do doesn't work for the same reason that you have to mask the depth buffer and render back to front/front to back when doing normal blending.

What you want is multisampling. Learn about the ARB_multisample extension.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement