]> git.mxchange.org Git - flightgear.git/blob - src/Viewer/renderingpipeline.hxx
Fix camera render orders
[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 namespace simgear
10 {
11 class SGReaderWriterOptions;
12 }
13 namespace flightgear
14 {
15 struct CameraInfo;
16 class CameraGroup;
17 }
18
19 class FGRenderingPipeline;
20 namespace flightgear {
21     FGRenderingPipeline* makeRenderingPipeline(const std::string& name,
22                    const simgear::SGReaderWriterOptions* options);
23 }
24
25 class FGRenderingPipeline : public osg::Referenced {
26 public:
27     struct Buffer : public osg::Referenced {
28         Buffer(SGPropertyNode* prop);
29
30         std::string name;
31         GLint internalFormat;
32         GLenum sourceFormat;
33         GLenum sourceType;
34         int width;
35         int height;
36         float scaleFactor;
37         GLenum wrapMode;
38                 bool shadowComparison;
39                 //GLenum shadowTextureMode;
40                 //osg::Vec4 borderColor;
41     };
42
43     struct Pass : public osg::Referenced {
44         Pass(SGPropertyNode* prop);
45
46         std::string name;
47         std::string type;
48     };
49
50     struct Attachment : public osg::Referenced {
51         Attachment(SGPropertyNode* prop);
52         Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
53
54         osg::Camera::BufferComponent component;
55         std::string buffer;
56     };
57     typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
58
59     struct Stage : public osg::Referenced {
60         Stage(SGPropertyNode* prop);
61
62         std::string name;
63         std::string type;
64         int orderNum;
65         std::string effect;
66         bool needsDuDv;
67         float scaleFactor;
68
69         std::vector<osg::ref_ptr<Pass> > passes;
70         AttachmentList attachments;
71     };
72     FGRenderingPipeline();
73
74     std::vector<osg::ref_ptr<Buffer> > buffers;
75     std::vector<osg::ref_ptr<Stage> > stages;
76
77     friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
78                    const simgear::SGReaderWriterOptions* options);
79 };
80
81 #endif