PDA

View Full Version : [QtOpenGL] gl_blend vs MultiSampled



muby
31st December 2012, 00:15
[QtOpenGL] gl_blend vs MultiSampled
Hi,

I'm new in OpenGL and I made some tests with Qt example about "Aliasing".

I would like to be sure about my results.

It's seem the result of "Anti-aliasing" to be more beautiful with the "gl_blend" method

Graphic card : ATI Mobility Radeon HD 4650

my results :

http://muby53.free.fr/Aide/full.jpg

I test the different settings of the drivers ATI :

wide-tent
box
narrow-tent
edge-detect


with differents samples (setSample(2/4/8))

for me the best "Anti-aliasing" is without multisampled.

Here the code for my test.




int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGLFormat format = QGLFormat::defaultFormat();
format.setSampleBuffers(false);
//format.setSamples(2);
//format.setSamples(4);
format.setSamples(8);
MyGlWindow*_glwindow= new MyGlWindow(format);
_glwindow->show();
return a.exec();
}





void MyGlWindow::initializeGL()
{
if(format().sampleBuffers())
{
glEnable(GL_MULTISAMPLE);
}
else
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

glEnable (GL_LINE_SMOOTH);
glEnable (GL_POINT_SMOOTH);
glEnable (GL_POLYGON_SMOOTH);
glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glHint (GL_POINT_SMOOTH_HINT, GL_DONT_CARE);
glHint (GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
}
}



To finish, is it normal that we can't get the same "anti-aliasing" result with "GL_MULTISAMPLE" ?


thx.