From: Tim Moore Date: Sat, 21 Nov 2009 23:27:53 +0000 (+0100) Subject: Effect file support for GL_VERTEX_PROGRAM_TWO_SIDE and POINT_SIZE X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1a400b890ba00c16868074a10585432dc0d5624c;p=simgear.git Effect file support for GL_VERTEX_PROGRAM_TWO_SIDE and POINT_SIZE --- diff --git a/simgear/scene/material/Effect.cxx b/simgear/scene/material/Effect.cxx index 1cff2323..4dae4825 100644 --- a/simgear/scene/material/Effect.cxx +++ b/simgear/scene/material/Effect.cxx @@ -761,6 +761,41 @@ struct PolygonModeBuilder : public PassAttributeBuilder }; InstallAttributeBuilder 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() + ? StateAttribute::ON : StateAttribute::OFF)); + } +}; + +InstallAttributeBuilder +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() + ? StateAttribute::ON : StateAttribute::OFF)); + } +}; + +InstallAttributeBuilder +installPointSize("vertex-program-point-size"); + void buildTechnique(Effect* effect, const SGPropertyNode* prop, const osgDB::ReaderWriter::Options* options) {