- Timestamp:
- 07/06/10 14:19:26 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshadercomposition/osgshadercomposition.cpp
r11667 r11668 32 32 osg::Vec3d position(0.0,0.0,0.0); 33 33 34 osg::ShaderAttribute* sa1 = NULL; 35 34 36 { 35 37 osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; … … 41 43 osg::StateSet* stateset = pat->getOrCreateStateSet(); 42 44 osg::ShaderAttribute* sa = new osg::ShaderAttribute; 45 //sa->setType(osg::StateAttribute::Type(10000)); 46 sa1 = sa; 43 47 stateset->setAttribute(sa); 44 48 … … 73 77 74 78 } 79 #if 1 80 { 81 osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; 82 pat->setPosition(position); 83 pat->addChild(node); 75 84 85 position.x() += spacing; 86 87 osg::StateSet* stateset = pat->getOrCreateStateSet(); 88 osg::ShaderAttribute* sa = new osg::ShaderAttribute; 89 //sa->setType(osg::StateAttribute::Type(10000)); 90 stateset->setAttribute(sa); 91 92 // reuse the same ShaderComponent as the first branch 93 sa->setShaderComponent(sa1->getShaderComponent()); 94 sa->addUniform(new osg::Uniform("myColour",osg::Vec4(1.0f,1.0f,0.0f,1.0f))); 95 96 group->addChild(pat); 97 98 } 99 #endif 76 100 return group; 77 101 }
