]> git.mxchange.org Git - flightgear.git/blob - src/Viewer/renderingpipeline.hxx
Remove hard-coded lighting stage
[flightgear.git] / src / Viewer / renderingpipeline.hxx
1
2 #ifndef __FG_RENDERINGPIPELINE_HXX
3 #define __FG_RENDERINGPIPELINE_HXX 1
4
5 #include <osg/ref_ptr>
6 #include <osg/Camera>
7 #include <string>
8
9 #include <simgear/structure/SGExpression.hxx>
10
11 namespace simgear
12 {
13 class SGReaderWriterOptions;
14 }
15 namespace flightgear
16 {
17 struct CameraInfo;
18 class CameraGroup;
19 }
20
21 class FGRenderingPipeline;
22 namespace flightgear {
23     FGRenderingPipeline* makeRenderingPipeline(const std::string& name,
24                    const simgear::SGReaderWriterOptions* options);
25 }
26
27 class FGRenderingPipeline : public osg::Referenced {
28 public:
29     class Conditionable : public osg::Referenced {
30     public:
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);
36         bool valid();
37     protected:
38         bool _alwaysValid;
39         SGSharedPtr<SGExpressionb> _validExpression;
40     };
41     struct Buffer : public Conditionable {
42         Buffer(SGPropertyNode* prop);
43
44         std::string name;
45         GLint internalFormat;
46         GLenum sourceFormat;
47         GLenum sourceType;
48         int width;
49         int height;
50         float scaleFactor;
51         GLenum wrapMode;
52                 bool shadowComparison;
53                 //GLenum shadowTextureMode;
54                 //osg::Vec4 borderColor;
55     };
56
57     struct Pass : public Conditionable {
58         Pass(SGPropertyNode* prop);
59
60         std::string name;
61         std::string type;
62         int orderNum;
63         std::string effect;
64     };
65
66     struct Attachment : public Conditionable {
67         Attachment(SGPropertyNode* prop);
68         Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
69
70         osg::Camera::BufferComponent component;
71         std::string buffer;
72     };
73     typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
74
75     struct Stage : public Pass {
76         Stage(SGPropertyNode* prop);
77
78         bool needsDuDv;
79         float scaleFactor;
80
81         std::vector<osg::ref_ptr<Pass> > passes;
82         AttachmentList attachments;
83     };
84     FGRenderingPipeline();
85
86     std::vector<osg::ref_ptr<Buffer> > buffers;
87     std::vector<osg::ref_ptr<Stage> > stages;
88
89     friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
90                    const simgear::SGReaderWriterOptions* options);
91 };
92
93 namespace flightgear {
94
95 class PipelinePredParser : public simgear::expression::ExpressionParser
96 {
97 public:
98 protected:
99 };
100 }
101
102 #endif