2012-04-19 20:31:53 +02:00
|
|
|
|
|
|
|
#ifndef __FG_RENDERINGPIPELINE_HXX
|
|
|
|
#define __FG_RENDERINGPIPELINE_HXX 1
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
2012-05-01 16:44:59 +02:00
|
|
|
#include <osg/Camera>
|
2012-04-19 20:31:53 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace simgear
|
|
|
|
{
|
|
|
|
class SGReaderWriterOptions;
|
|
|
|
}
|
|
|
|
namespace flightgear
|
|
|
|
{
|
|
|
|
struct CameraInfo;
|
|
|
|
class CameraGroup;
|
|
|
|
}
|
|
|
|
|
|
|
|
class FGRenderingPipeline;
|
|
|
|
namespace flightgear {
|
|
|
|
FGRenderingPipeline* makeRenderingPipeline(const std::string& name,
|
|
|
|
const simgear::SGReaderWriterOptions* options);
|
|
|
|
}
|
|
|
|
|
|
|
|
class FGRenderingPipeline : public osg::Referenced {
|
|
|
|
public:
|
|
|
|
struct Buffer : public osg::Referenced {
|
|
|
|
Buffer(SGPropertyNode* prop);
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
GLint internalFormat;
|
|
|
|
GLenum sourceFormat;
|
|
|
|
GLenum sourceType;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
float scaleFactor;
|
|
|
|
GLenum wrapMode;
|
|
|
|
bool shadowComparison;
|
|
|
|
//GLenum shadowTextureMode;
|
|
|
|
//osg::Vec4 borderColor;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Pass : public osg::Referenced {
|
|
|
|
Pass(SGPropertyNode* prop);
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
std::string type;
|
|
|
|
};
|
|
|
|
|
2012-05-01 16:44:59 +02:00
|
|
|
struct Attachment : public osg::Referenced {
|
|
|
|
Attachment(SGPropertyNode* prop);
|
|
|
|
Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
|
|
|
|
|
|
|
|
osg::Camera::BufferComponent component;
|
|
|
|
std::string buffer;
|
|
|
|
};
|
2012-05-08 15:13:38 +02:00
|
|
|
typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
|
2012-05-01 16:44:59 +02:00
|
|
|
|
2012-04-19 20:31:53 +02:00
|
|
|
struct Stage : public osg::Referenced {
|
|
|
|
Stage(SGPropertyNode* prop);
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
std::string type;
|
2012-05-08 15:13:38 +02:00
|
|
|
int orderNum;
|
|
|
|
std::string effect;
|
2012-04-19 20:31:53 +02:00
|
|
|
|
|
|
|
std::vector<osg::ref_ptr<Pass> > passes;
|
2012-05-08 15:13:38 +02:00
|
|
|
AttachmentList attachments;
|
2012-04-19 20:31:53 +02:00
|
|
|
};
|
|
|
|
FGRenderingPipeline();
|
|
|
|
|
|
|
|
std::vector<osg::ref_ptr<Buffer> > buffers;
|
|
|
|
std::vector<osg::ref_ptr<Stage> > stages;
|
|
|
|
|
|
|
|
friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
|
|
|
|
const simgear::SGReaderWriterOptions* options);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|