PDA

View Full Version : Blending in poligon Drawing



PeshaShulc
03-10-2004, 06:30 AM
I'm drawing several small polygons with size something like 0.05 x 50.0 pixels, one near another.
I set some properties
glEnable(GL_POLYGON_SMOOTH);
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
But polygons looks like lines with 100% filling. And sometimes don't drawn at all (for example: if I shift picture 0.5 pixel)
Software rendering makes all fine with same settings.

Aeluned
03-10-2004, 07:19 AM
are you using glColor4f and setting an alpha value?

PeshaShulc
03-10-2004, 07:43 AM
Yes.
I was trying

glColor3ub(color.R, color.G, color.B);

and

glColor4ub(color.R, color.G, color.B, 255);

with similar results

Aeluned
03-10-2004, 08:10 AM
your alpha value of 255 is setting the alpha of the color to fully opaque.

try knocking that down some.
i.e. a value of 127 should give you polygons with 50% transparency.

PeshaShulc
03-10-2004, 08:24 AM
I'm expecting antialising, for example:
my rectangular 0.5, 1, 1, 2 will be drawn with 0.5 alpha index because it's size half of pixel.