2 #ifndef __FG_RENDERINGPIPELINE_HXX
3 #define __FG_RENDERINGPIPELINE_HXX 1
9 #include <simgear/structure/SGExpression.hxx>
13 class SGReaderWriterOptions;
21 class FGRenderingPipeline;
22 namespace flightgear {
23 FGRenderingPipeline* makeRenderingPipeline(const std::string& name,
24 const simgear::SGReaderWriterOptions* options);
27 class FGRenderingPipeline : public osg::Referenced {
29 class Conditionable : public osg::Referenced {
31 Conditionable() : _alwaysValid(false) {}
32 void parseCondition(SGPropertyNode* prop);
33 bool getAlwaysValid() const { return _alwaysValid; }
34 void setAlwaysValid(bool val) { _alwaysValid = val; }
35 void setValidExpression(SGExpressionb* exp);
39 SGSharedPtr<SGExpressionb> _validExpression;
41 struct Buffer : public Conditionable {
42 Buffer(SGPropertyNode* prop);
52 bool shadowComparison;
53 //GLenum shadowTextureMode;
54 //osg::Vec4 borderColor;
57 struct Pass : public Conditionable {
58 Pass(SGPropertyNode* prop);
64 struct Attachment : public Conditionable {
65 Attachment(SGPropertyNode* prop);
66 Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
68 osg::Camera::BufferComponent component;
71 typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
73 struct Stage : public Conditionable {
74 Stage(SGPropertyNode* prop);
83 std::vector<osg::ref_ptr<Pass> > passes;
84 AttachmentList attachments;
86 FGRenderingPipeline();
88 std::vector<osg::ref_ptr<Buffer> > buffers;
89 std::vector<osg::ref_ptr<Stage> > stages;
91 friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
92 const simgear::SGReaderWriterOptions* options);
95 namespace flightgear {
97 class PipelinePredParser : public simgear::expression::ExpressionParser