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(true) {}
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 std::string debugProperty;
67 struct Attachment : public Conditionable {
68 Attachment(SGPropertyNode* prop);
69 Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
71 osg::Camera::BufferComponent component;
74 typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
76 struct Stage : public Pass {
77 Stage(SGPropertyNode* prop);
82 std::vector<osg::ref_ptr<Pass> > passes;
83 AttachmentList attachments;
85 FGRenderingPipeline();
87 std::vector<osg::ref_ptr<Buffer> > buffers;
88 std::vector<osg::ref_ptr<Stage> > stages;
90 friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
91 const simgear::SGReaderWriterOptions* options);
94 namespace flightgear {
96 class PipelinePredParser : public simgear::expression::ExpressionParser