Re: [osg-users] #pragmatic composition : setDefine

2015-04-21 Thread Trajce Nikolov NICK
Thanks Sebastian,

I thought it would be that easy

Cheers,
Nick

On Tue, Apr 21, 2015 at 7:33 AM, Sebastian Messerschmidt 
sebastian.messerschm...@gmx.de wrote:

  Hi Nick,

Hi Robert, all,

  I finally ported all my shaders to the this new thing. I have a question.
 Probably simple but will go anyway

  in my shader I have something like

  #define MYDEFINE
  .. do stuff here ...
  #endif

  at the root of the scene I have
  stateSet-setDefine(MYDEFINE);

  how can I fornid this define somewhere down the tree ? Simple removing it
 is not helping (as expected I guess).

 Do you mean unsetting?
 Then simply do setDefines(MYDEFINE, osg::StateAttribute::OFF) where you
 like it to have it disabled.
 The rules for the overriding / protecting apply to this as well.


  Any sample how the defines with Values set works?

 Simply by setDefine(MY_VALUE_DEFINE, 42, osg::StateAttribute::ON)

 or Roberts example defining a function:

 stateset-setDefine(VERTEX_FUNC(v) , vec4(v.x, v.y, v.z *
 sin(osg_SimulationTime), v.w));


  Thanks a bunch !

  Nick

 --
 trajce nikolov nick


 ___
 osg-users mailing 
 listosg-users@lists.openscenegraph.orghttp://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


[osg-users] #pragmatic composition : setDefine

2015-04-20 Thread Trajce Nikolov NICK
Hi Robert, all,

I finally ported all my shaders to the this new thing. I have a question.
Probably simple but will go anyway

in my shader I have something like

#define MYDEFINE
.. do stuff here ...
#endif

at the root of the scene I have
stateSet-setDefine(MYDEFINE);

how can I fornid this define somewhere down the tree ? Simple removing it
is not helping (as expected I guess).

Any sample how the defines with Values set works?

Thanks a bunch !

Nick

-- 
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] #pragmatic composition : setDefine

2015-04-20 Thread Sebastian Messerschmidt

Hi Nick,


Hi Robert, all,

I finally ported all my shaders to the this new thing. I have a 
question. Probably simple but will go anyway


in my shader I have something like

#define MYDEFINE
.. do stuff here ...
#endif

at the root of the scene I have
stateSet-setDefine(MYDEFINE);

how can I fornid this define somewhere down the tree ? Simple removing 
it is not helping (as expected I guess).

Do you mean unsetting?
Then simply do setDefines(MYDEFINE, osg::StateAttribute::OFF) where 
you like it to have it disabled.

The rules for the overriding / protecting apply to this as well.



Any sample how the defines with Values set works?

Simply by setDefine(MY_VALUE_DEFINE, 42, osg::StateAttribute::ON)

or Roberts example defining a function:

stateset-setDefine(VERTEX_FUNC(v) , vec4(v.x, v.y, v.z * 
sin(osg_SimulationTime), v.w));




Thanks a bunch !

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