PDA

View Full Version : GL_POLYGON_SMOOTH



jono_123
10-18-2002, 11:08 PM
hi
i did :
glEnable(GL_POLYGON_SMOOTH);
glutSolidCube(1.0);

but i get white lines accross the diagonals of the cube
whats going on here and how do i get rid of it?
thanks

[This message has been edited by jono_123 (edited 10-19-2002).]

[This message has been edited by jono_123 (edited 10-22-2002).]

Leyder Dylan
10-18-2002, 11:16 PM
Try this :

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

glEnable(GL_POLYGON_SMOOTH);

// Draw uour cube

jono_123
10-18-2002, 11:19 PM
nope it still has white lines across the diagonals

harsman
10-19-2002, 12:44 AM
For polygon smoothing to work you hae to render polygons in back to front (or front to back, can't remember) order. glutSolidCube won't work. You also have to set the appropriate blend mode. There are about 100 threads on this at these forums (at least in the advanced forum), do a search and you will be enlightened.

*Aaron*
10-19-2002, 06:51 AM
It's back to front.

V-man
10-19-2002, 12:00 PM
It's is an effect from double blending at the edges.

V-man

jono_123
10-19-2002, 07:44 PM
yes this sounds like my problem
how do i get rid of this?


Originally posted by V-man:
It's is an effect from double blending at the edges.

V-man

Anitox
10-21-2002, 10:17 AM
Either write a new method to draw the solid cube, or ...

glDisable(GL_POLYGON_SMOOTH);
// draw cube
glEnable(GL_POLYGON_SMOOTH);

Anitox

jono_123
10-21-2002, 10:18 PM
no see but i want the cube to be smoothed

Mazy
10-22-2002, 12:23 AM
try the blendmode

glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);

or on consumer HW you can aim for Fullscreen Antialiasing

harsman
10-22-2002, 04:35 AM
I've already posted what you need to do to get the cube to render correctly, look at my post above. You can't use glutSolidCube. What part of this are you confused about?