Re: [osg-users] Camera default stateset ???

2015-01-12 Thread Robert Osfield
Hi Nick,


osg::Camera is just an Node so to set the state that you want to get
inherited to everything below it you simple do:

  osg::StateSet* ss = camera-getOrCreateStateSet();
  ss-set*();

Robert.

On 11 January 2015 at 20:48, Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com wrote:

 Hi Community,

 I remember there was a change in the later OSG for calling explicitlly the
 setting of some defaults for the Camera (not sure though) stateset?? or
 something like that?

 If you know what I mean can you point me to the right thing? I tried to
 find it in the archive with no luck

 Thanks a bunch as always

 Nick

 --
 trajce nikolov nick

 ___
 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] Camera default stateset ???

2015-01-12 Thread Robert Osfield
Hi Nick,

On 12 January 2015 at 09:54, Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com wrote:

 yes, I know that, but thanks. I was looking for some setDefaults or
 something similar. I can not clearly recall the change you made in the
 later osg to explicitly set some defaults so I was shooting in the fog
 hoping someone will remember it better.


What is appropriate totally depends upon the context and needs.  In
osg::StateSet there is a setGlobalDefaults() method that gets set for the
master Camera or a View(er) so you don't need to set this.
setGlobalDefaults() sets some OpenGL state that is off by default such as
depth test.

A default constructed osg::Camera doesn't have an osg::StateSet assigned
though, so if you create our own osg::Camera and assign this to the
View(er) then you'll need to call StateSet::setGlobalDefaults().

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


Re: [osg-users] Camera default stateset ???

2015-01-12 Thread Trajce Nikolov NICK
yes That is what I was look for !! Thanks a bunch Robert!

Nick

On Mon, Jan 12, 2015 at 12:28 PM, Robert Osfield robert.osfi...@gmail.com
wrote:

 Hi Nick,

 On 12 January 2015 at 09:54, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 yes, I know that, but thanks. I was looking for some setDefaults or
 something similar. I can not clearly recall the change you made in the
 later osg to explicitly set some defaults so I was shooting in the fog
 hoping someone will remember it better.


 What is appropriate totally depends upon the context and needs.  In
 osg::StateSet there is a setGlobalDefaults() method that gets set for the
 master Camera or a View(er) so you don't need to set this.
 setGlobalDefaults() sets some OpenGL state that is off by default such as
 depth test.

 A default constructed osg::Camera doesn't have an osg::StateSet assigned
 though, so if you create our own osg::Camera and assign this to the
 View(er) then you'll need to call StateSet::setGlobalDefaults().

 Robert.

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




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


Re: [osg-users] Camera default stateset ???

2015-01-12 Thread Trajce Nikolov NICK
Hi Robert,

yes, I know that, but thanks. I was looking for some setDefaults or
something similar. I can not clearly recall the change you made in the
later osg to explicitly set some defaults so I was shooting in the fog
hoping someone will remember it better.

Thanks again

Nick

On Mon, Jan 12, 2015 at 10:04 AM, Robert Osfield robert.osfi...@gmail.com
wrote:

 Hi Nick,


 osg::Camera is just an Node so to set the state that you want to get
 inherited to everything below it you simple do:

   osg::StateSet* ss = camera-getOrCreateStateSet();
   ss-set*();

 Robert.

 On 11 January 2015 at 20:48, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 Hi Community,

 I remember there was a change in the later OSG for calling explicitlly
 the setting of some defaults for the Camera (not sure though) stateset?? or
 something like that?

 If you know what I mean can you point me to the right thing? I tried to
 find it in the archive with no luck

 Thanks a bunch as always

 Nick

 --
 trajce nikolov nick

 ___
 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




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