Filter

Can I filter the render result? In DirectX this function called ALPHA-BLENDING. How I can use it in OpenGL?

Sorry for bad English

Originally posted by Dimae:
[b]Can I filter the render result? In DirectX this function called ALPHA-BLENDING. How I can use it in OpenGL?

Sorry for bad English [/b]

Originally posted by ben:

It’s basically the same for OpenGL. Look in the Red Book for info on blending. You’ll see functions like:
glEnable(GL_BLEND);
glBlendFunc(…); <– Or something. I forget the exact call.

And some other stuff. There’s also an alpha test that might be what you’re looking for.
It goes something like:
glEnable(GL_ALPHAv_TEST);
glAlphaFunc(…);

glEnable(GL_BLEND);
glBlendFunc(…);
glAlphaFunc(…);

What’s a parameters? I want to smooth this BIG Pixels!

What exactly do you want to do??

Smooth your Polygons, blend 2 Poylgons or just do you want to have transparent areas

Originally posted by Dimae:
[b]glEnable(GL_BLEND);
glBlendFunc(…);
glAlphaFunc(…);

What’s a parameters? I want to smooth this BIG Pixels!
[/b]

If you mean magnified texture pixels (texels) then this might help:

glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER,GL_LINEAR);

after creating your texture object. GL_TEXTURE_MIN/MAG_FILTER set the interpolation for texture minification/magnification. AFAIK default is GL_NEAREST, so there will be no interpolation between two texel values… that’s when you get the ‘playstation effect’.

Maybe you mean anti-aliasing?
tFz

May be yes. I don’t know how named this function in OpenGL. In small screen resulutions without hardware acceleration pixels of my on the screen are very big. I want smooth its.

If you are drawing polygons, you can do it in this way:

glHint(GL_POLYGON_SMOOTH_HINT,GL_NICEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_POLYGON_SMOOTH);

Make sure that blending is always enabled. My code modifies it while drawing bumpmapped object, and they aren’t antialiased. But I think that with some trick…
Another way to antialias is to use the accumulation buffer, but this requires to draw the entire scene more than once.
tFz