Will that cummulate the effect of the two shaders node ? i.e. the final 
rendering have both
per-pixel lighting from Node 1 and vertices displaced from Node 2 ?


/g



I think osgNVCg is just like any StateAttribute.  So, how about

Node1->getOrCreateStateSet()->setAttributeAndModes(vertex, 
osg::StateAttribute::ON);
Node1->getOrCreateStateSet()->setAttributeAndModes(fragment, 
osg::StateAttribute::ON);

Node2->getOrCreateStateSet()->setAttributeAndModes(fragment, 
osg::StateAttribute::OFF);

Node1->addChild(Node2);
Root->addChild(Node1);


William




Hello,


I am wondering how to achieve the following... I'd like to have nodes in my 
scene graph with different cascading shaders. For example a node 1 doing 
per-pixel
Blinn and another node 2 doing vertex displacements. 

Root
  \ 
  Node 1 
  osgNVCg vertex
  osgNVCg fragment
      \
      Node 2
      osgNVCg vertex


/g
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

<<winmail.dat>>

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to