Skip to main content
gamedev.net
🔒 Locked

Antialiasing

Started by encom Dec 5, 2002 at 7:32 AM 3 replies 250+ views
Original Post
encom
encom
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 ?
vincoof
vincoof
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.
encom
encom
I have ever done it, then blending is ok, and i draw the solid before the wire. It doesnt work.
vincoof
vincoof
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 ?
encom
encom
Woow,


thank you very much, it works now. thanks a lot :-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.