• Advertisement

Archived

This topic is now archived and is closed to further replies.

Antialiasing

This topic is 5555 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

Hi, I have a pb with line antialising. I display a 2D structure with plain polygons, then i display the same structure with Wired polygone to make a wired and solid display. if antialiasing is enabled, the lines (white color) use the black background color to make antialiasing, it doesnt use the color of the polygons. It''s ugly. How to chose the antialiasing color ?

Share this post


Link to post
Share on other sites
Advertisement
There is no "antialiasing color". Line antialiasing (if you''re using GL_LINE_SMOOTH) just blends with the color of the pixel that is already rendered behind him.
You need to enable blending and to setup with something like that :
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Also, the rendering order is important since I guess you''re using the Z-Buffer, n''est-ce pas ? You should render the wireframe model after the solid model.

Share this post


Link to post
Share on other sites
I have ever done it, then blending is ok, and i draw the solid before the wire. It doesnt work.

Share this post


Link to post
Share on other sites
Also, you should depth-test but not depth-write while you''re rendering the wireframe model :
glEnable(GL_DEPTH_TEST);
render_solid();
glDepthMask(GL_FALSE); // Don''t write to the depth buffer, but read it to test it anyway
render_wire();
glDepthMask(GL_TRUE); // Write to the depth buffer again

Also, the universal question : what is your graphics card / driver / OS combo ?

Share this post


Link to post
Share on other sites

  • Advertisement