Hi Per,

The DisplaySettings singleton just provides defaults for any automatically
windows create by osgViewer's setUpView*() convenience functions.  If you
create the GraphicsContext::Traits, when creating graphics windows yourself,
you can manually set the number of samples, same applies if you use MFC/QT
etc. to create your own graphics windows.

Robert.

On Tue, Apr 15, 2008 at 2:02 PM, Per Rosengren <[EMAIL PROTECTED]> wrote:

> 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
> >
> >
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to