Sign in to follow this  
MrDoomMaster

Antialiasing Blending Problem

Recommended Posts

MrDoomMaster    103
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
RichardS    298
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this