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);
66 struct Attachment : public Conditionable {
67 Attachment(SGPropertyNode* prop);
68 Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
70 osg::Camera::BufferComponent component;
73 typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
75 struct Stage : public Pass {
76 Stage(SGPropertyNode* prop);
81 std::vector<osg::ref_ptr<Pass> > passes;
82 AttachmentList attachments;
84 FGRenderingPipeline();
86 std::vector<osg::ref_ptr<Buffer> > buffers;
87 std::vector<osg::ref_ptr<Stage> > stages;
89 friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
90 const simgear::SGReaderWriterOptions* options);
93 namespace flightgear {
95 class PipelinePredParser : public simgear::expression::ExpressionParser