Thank you (both)! It works!

I'm still a bit confused. I thought that this would be done by setting some
property of the viewer or the camera. This solution seems to change some global
setting for the osg application, or maybe the graphics card.

How long does this setting last? Will it be active on all frames in all windows
rendered by osg from

    osg::DisplaySettings::instance()->setNumMultiSamples(8);

is called until program exit?


Stephane Lamoliatte wrote:
> Try this code sample :
> 
> int main(int argc, char** argv) {
>     osgViewer::Viewer viewer;
>     osg::DisplaySettings::instance()->setNumMultiSamples(8);
> 
>     viewer.setSceneData(buildMyScene());
>     return viewer.run();
> }
> 
> Per Rosengren a écrit :
>> I have tried to enable multi sampling, but it has no effect. This is how I 
>> try
>> to activate it:
>>
>>
>> modelView = new osgViewer::View;
>>
>> modelView->setUpViewInWindow
>>              (400, //x
>>               0, //y
>>               640, //width
>>               480); //height
>>
>> modelView->getCamera()->getOrCreateStateSet();
>>
>> stateSet->setAttributeAndModes(new osg::Multisample, 
>> osg::StateAttribute::ON);
>>
>> stateSet->setMode(GL_MULTISAMPLE, osg::StateAttribute::ON |
>> osg::StateAttribute::OVERRIDE);
>>
>>
>> I attach my output from glxinfo. It shows what extensions my nvidia card 
>> supports.
>>   
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> 
begin:vcard
fn:Per Rosengren
n:Rosengren;Per
org:Royal Institute of Technology (KTH);Computational Vision and Active Perception Laboratory
adr:;;Teknikringen 14, room 621;Stockholm;;11428;Sweden
email;internet:[EMAIL PROTECTED]
title:Ph.D. student
tel;work:+46 8 7906203
note:PGP keyID: 0xD40DD8E0
x-mozilla-html:FALSE
url:http://www.csc.kth.se/~perrose/
version:2.1
end:vcard

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to