makeParametersFromStateSet(ssRoot, ss);
SGPropertyNode_ptr effectRoot = new SGPropertyNode;
effect::mergePropertyTrees(effectRoot, ssRoot, _currentEffectParent);
- Effect* effect = makeEffect(effectRoot, true, _options);
+ Effect* effect = makeEffect(effectRoot, true, _options.get());
EffectGeode* eg = dynamic_cast<EffectGeode*>(&geode);
if (eg) {
eg->setEffect(effect);
ref_ptr<SGSceneUserData> userData = SGSceneUserData::getSceneUserData(&geode);
if (userData.valid())
eg->setUserData(new SGSceneUserData(*userData));
- for (int i = 0; i < geode.getNumDrawables(); ++i)
- eg->addDrawable(geode.getDrawable(i));
+ for (int i = 0; i < geode.getNumDrawables(); ++i) {
+ osg::Drawable *drawable = geode.getDrawable(i);
+ eg->addDrawable(drawable);
+
+ // Generate tangent vectors etc if needed
+ osg::Geometry *geom = dynamic_cast<osg::Geometry*>(drawable);
+ if(geom) eg->runGenerators(geom);
+ }
}
pushResultNode(&geode, eg);