Re: [osg-users] Multisampling

2013-02-13 Thread Filip Arlet
Hi,

Well, the best solution in this case is recreating context without MSAA. How do 
I do that ?

Thank you!

Cheers,
Filip

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52629#52629





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisampling

2013-01-28 Thread Sergey Polischuk
Hi, Filip

you can create MSAA context and enable\disable multisampling at runtime with 
GL_MULTISAMPLE mode on camera or scene stateset. Note that with disabled 
multisampling you will get lower fps than with non-MSAA context.

Cheers,
Sergey.

28.01.2013, 20:24, "Filip Arlet" :
> Hi,
>
> Is it possilbe to disable (or enable) Multisampling ? I can create context 
> with MSAA and without it, but I have no idea how can I disable or enable it 
> with existing context ? Is it even posible or do I have to recreate Context ?
>
> Thank you!
>
> Cheers,
> Filip
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52245#52245
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling in embedded window?

2009-11-11 Thread Dominic Stalder
Hi Raphael

I have exactly the same problem, how did you solve it?

Thanks a lot in advance
Dominic

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=19471#19471





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling antialiasing in OSG

2009-03-30 Thread Robert Osfield
HI Gianluca,

Another approach you can try is to the set the defaults the graphics windows
open up with in osgViewer by use the DislpaySettings singleton.  The
osgthirdpersonexample illustrates this in action.  Look for the line:

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

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling antialiasing in OSG

2009-03-30 Thread Gianluca Natale
Thank you so much, I’ll try.

Gianluca

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ümit Uzun
Sent: lunedì 30 marzo 2009 11.55
To: OpenSceneGraph Users
Subject: Re: [osg-users] multisampling antialiasing in OSG

 

Hi Gianluca;

I recommend you to use multisampling to implement antialiasing.
You can enable multisample while creating GraphicsContext.

// Init the GraphicsContext Traits.
osg::ref_ptr traits = new
osg::GraphicsContext::Traits;

// Setup the traits parameters.
traits->samples   = 4; // to make anti-aliased.

HTH. Best Regards.

2009/3/30 Gianluca Natale 

Hi all.
I’m using OSG 2.8, I’d like to know if it supports multisampling
antialiasing,
and how I can enable it.

 

Thanks,

Gianluca Natale

 

P.S.= I tried to search for GL_MULTISAMPLE in the whole OSG source code, but
I couldn’t find it.

 


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Ümit Uzun

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.31/2029 - Release Date: 03/29/09
16:56:00

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling antialiasing in OSG

2009-03-30 Thread Ümit Uzun
Hi Gianluca;

I recommend you to use multisampling to implement antialiasing.
You can enable multisample while creating GraphicsContext.

// Init the GraphicsContext Traits.
osg::ref_ptr traits = new
osg::GraphicsContext::Traits;

// Setup the traits parameters.
traits->samples   = 4; // to make anti-aliased.

HTH. Best Regards.

2009/3/30 Gianluca Natale 

>  Hi all.
> I’m using OSG 2.8, I’d like to know if it supports multisampling
> antialiasing,
> and how I can enable it.
>
>
>
> Thanks,
>
> Gianluca Natale
>
>
>
> P.S.= I tried to search for GL_MULTISAMPLE in the whole OSG source code,
> but I couldn’t find it.
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Ümit Uzun
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling in embedded window?

2008-11-18 Thread Raphael Sebbe
Some conclusions: the opengl context created in Interface Builder did not
respect the requested settings (multisample and sample count). Providing a
pixel format manually fixed this issue. As you said, nothing special has to
be done on OSG side.
Thanks,

Raphael

On Tue, Nov 18, 2008 at 11:22 AM, Raphael Sebbe <[EMAIL PROTECTED]>wrote:

> Hi Robert,
> Thank you, I was not aware of that. I'll experiment some more.
>
> Raphael
>
>
> On Tue, Nov 18, 2008 at 11:14 AM, Robert Osfield <[EMAIL PROTECTED]
> > wrote:
>
>> Hi Raphael,
>>
>> If you are embedded the OSG within an existing OpenGL graphics context
>> then no OSG settings will make any difference, you'll have to request
>> a multi-sample visual from whatever toolkit you are using to create
>> the graphic context.
>>
>> Robert.
>>
>> On Tue, Nov 18, 2008 at 10:01 AM, Raphael Sebbe <[EMAIL PROTECTED]>
>> wrote:
>> > Hi,
>> > I am trying to enable multisampling in an embedded viewer, with no luck
>> so
>> > far. It works great on stand alone Viewer though.
>> > Here is what I do:
>> >
>> > Create an OpenGL buffer with multisampling enabled. Then, this:
>> > osg::DisplaySettings * ds = osg::DisplaySettings::instance();
>> > ds->setNumMultiSamples(4);
>> > _osgViewData->window =
>> >
>> _osgViewData->viewer->setUpViewerAsEmbeddedInWindow(100,100,bounds.width,
>> > bounds.height);
>> >
>> > But this doesn't make it. I also tried this:
>> > ref_ptr< DisplaySettings > displaySettings = new DisplaySettings;
>> > displaySettings->setNumMultiSamples(4);
>> > _osgViewData->viewer->setDisplaySettings( displaySettings.get() );
>> > _osgViewData->window =
>> >
>> _osgViewData->viewer->setUpViewerAsEmbeddedInWindow(100,100,bounds.width,
>> > bounds.height);
>> > Same result.
>> > Do you have any recommendation on what to check to make multisampling
>> > anti-aliasing work?
>> > Thank you,
>> > Raphael
>> > ___
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling in embedded window?

2008-11-18 Thread Raphael Sebbe
Hi Robert,
Thank you, I was not aware of that. I'll experiment some more.

Raphael

On Tue, Nov 18, 2008 at 11:14 AM, Robert Osfield
<[EMAIL PROTECTED]>wrote:

> Hi Raphael,
>
> If you are embedded the OSG within an existing OpenGL graphics context
> then no OSG settings will make any difference, you'll have to request
> a multi-sample visual from whatever toolkit you are using to create
> the graphic context.
>
> Robert.
>
> On Tue, Nov 18, 2008 at 10:01 AM, Raphael Sebbe <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> > I am trying to enable multisampling in an embedded viewer, with no luck
> so
> > far. It works great on stand alone Viewer though.
> > Here is what I do:
> >
> > Create an OpenGL buffer with multisampling enabled. Then, this:
> > osg::DisplaySettings * ds = osg::DisplaySettings::instance();
> > ds->setNumMultiSamples(4);
> > _osgViewData->window =
> > _osgViewData->viewer->setUpViewerAsEmbeddedInWindow(100,100,bounds.width,
> > bounds.height);
> >
> > But this doesn't make it. I also tried this:
> > ref_ptr< DisplaySettings > displaySettings = new DisplaySettings;
> > displaySettings->setNumMultiSamples(4);
> > _osgViewData->viewer->setDisplaySettings( displaySettings.get() );
> > _osgViewData->window =
> > _osgViewData->viewer->setUpViewerAsEmbeddedInWindow(100,100,bounds.width,
> > bounds.height);
> > Same result.
> > Do you have any recommendation on what to check to make multisampling
> > anti-aliasing work?
> > Thank you,
> > Raphael
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multisampling in embedded window?

2008-11-18 Thread Robert Osfield
Hi Raphael,

If you are embedded the OSG within an existing OpenGL graphics context
then no OSG settings will make any difference, you'll have to request
a multi-sample visual from whatever toolkit you are using to create
the graphic context.

Robert.

On Tue, Nov 18, 2008 at 10:01 AM, Raphael Sebbe <[EMAIL PROTECTED]> wrote:
> Hi,
> I am trying to enable multisampling in an embedded viewer, with no luck so
> far. It works great on stand alone Viewer though.
> Here is what I do:
>
> Create an OpenGL buffer with multisampling enabled. Then, this:
> osg::DisplaySettings * ds = osg::DisplaySettings::instance();
> ds->setNumMultiSamples(4);
> _osgViewData->window =
> _osgViewData->viewer->setUpViewerAsEmbeddedInWindow(100,100,bounds.width,
> bounds.height);
>
> But this doesn't make it. I also tried this:
> ref_ptr< DisplaySettings > displaySettings = new DisplaySettings;
> displaySettings->setNumMultiSamples(4);
> _osgViewData->viewer->setDisplaySettings( displaySettings.get() );
> _osgViewData->window =
> _osgViewData->viewer->setUpViewerAsEmbeddedInWindow(100,100,bounds.width,
> bounds.height);
> Same result.
> Do you have any recommendation on what to check to make multisampling
> anti-aliasing work?
> Thank you,
> Raphael
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisampling: How to enable

2008-04-15 Thread Per Rosengren
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]
> > 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
> >> osg-users@lists.openscenegraph.org
> 
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisampling: How to enable

2008-04-15 Thread Robert Osfield
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
> >> osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisampling: How to enable

2008-04-15 Thread Per Rosengren
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
>> osg-users@lists.openscenegraph.org
>> 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisampling: How to enable

2008-04-15 Thread Stephane Lamoliatte
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
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


-- 
Lamoliatte Stephane
Ingenieur R&D

R.S.A. Cosmos
Z.I. de la Vaure - B.P.40
42290 Sorbiers, France
Tél : +33 (0)4 77 53 30 48
Fax : +33 (0)4 77 53 38 61

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multisampling: How to enable

2008-04-15 Thread Paul Melis
 From example/osgthirdpersonview/osgthirdpersonview.cpp

 
osgViewer::CompositeViewer viewer( arguments );
// Turn on FSAA, makes the lines look better.
osg::DisplaySettings::instance()->setNumMultiSamples( 4 );
...

Perhaps that example can help you further along

Paul

Per Rosengren wrote:

>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
>osg-users@lists.openscenegraph.org
>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>  
>

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org