This is the new code I use to create my multi sampled windows:
ref_ptr< DisplaySettings > displaySettings = new DisplaySettings;
displaySettings->setNumMultiSamples(16);
modelView->setDisplaySettings( displaySettings.get() );
modelView->setUpViewInWindow...
I can now mix multisampled and unmultisampled windows in a composite viewer.
Thank you!
Per
Robert Osfield wrote:
> 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]
> <mailto:[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]
> <mailto:[email protected]>
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> <mailto:[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
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