if (name)
glyphs[name] = new SGMaterialGlyph(glyph_nodes[i]);
}
+
+ // Read parameters entry, which is passed into the effect
+ if (props->hasChild("parameters")) {
+ parameters = props->getChild("parameters");
+ } else {
+ parameters = new SGPropertyNode();
+ }
// Read conditions node
const SGPropertyNode *conditionNode = props->getChild("condition");
ref_ptr<SGMaterialUserData> user = new SGMaterialUserData(this);
SGPropertyNode_ptr propRoot = new SGPropertyNode();
makeChild(propRoot, "inherits-from")->setStringValue(effect);
+
SGPropertyNode* paramProp = makeChild(propRoot, "parameters");
+ copyProperties(parameters, paramProp);
+
SGPropertyNode* materialProp = makeChild(paramProp, "material");
makeChild(materialProp, "ambient")->setValue(SGVec4d(ambient));
makeChild(materialProp, "diffuse")->setValue(SGVec4d(diffuse));
// Condition, indicating when this material is active
SGSharedPtr<const SGCondition> condition;
+
+ // Parameters from the materials file
+ const SGPropertyNode* parameters;
////////////////////////////////////////////////////////////////////
// Internal constructors and methods.