Effect file support for GL_VERTEX_PROGRAM_TWO_SIDE and POINT_SIZE

This commit is contained in:
Tim Moore
2009-11-22 00:27:53 +01:00
parent ebe5a5579c
commit 1a400b890b

View File

@@ -761,6 +761,41 @@ struct PolygonModeBuilder : public PassAttributeBuilder
};
InstallAttributeBuilder<PolygonModeBuilder> installPolygonMode("polygon-mode");
struct VertexProgramTwoSideBuilder : public PassAttributeBuilder
{
void buildAttribute(Effect* effect, Pass* pass, const SGPropertyNode* prop,
const osgDB::ReaderWriter::Options* options)
{
const SGPropertyNode* realProp = getEffectPropertyNode(effect, prop);
if (!realProp)
return;
pass->setMode(GL_VERTEX_PROGRAM_TWO_SIDE,
(realProp->getValue<bool>()
? StateAttribute::ON : StateAttribute::OFF));
}
};
InstallAttributeBuilder<VertexProgramTwoSideBuilder>
installTwoSide("vertex-program-two-side");
struct VertexProgramPointSizeBuilder : public PassAttributeBuilder
{
void buildAttribute(Effect* effect, Pass* pass, const SGPropertyNode* prop,
const osgDB::ReaderWriter::Options* options)
{
const SGPropertyNode* realProp = getEffectPropertyNode(effect, prop);
if (!realProp)
return;
pass->setMode(GL_VERTEX_PROGRAM_POINT_SIZE,
(realProp->getValue<bool>()
? StateAttribute::ON : StateAttribute::OFF));
}
};
InstallAttributeBuilder<VertexProgramPointSizeBuilder>
installPointSize("vertex-program-point-size");
void buildTechnique(Effect* effect, const SGPropertyNode* prop,
const osgDB::ReaderWriter::Options* options)
{