Merge branch 'master' into feature/FXAA

# Conflicts:
#	include/openspace/rendering/framebufferrenderer.h
#	include/openspace/rendering/renderer.h
#	src/rendering/framebufferrenderer.cpp
This commit is contained in:
Alexander Bock
2019-08-20 14:47:01 +02:00
13 changed files with 163 additions and 186 deletions
@@ -59,70 +59,6 @@ struct UpdateStructures;
class FramebufferRenderer : public Renderer, public RaycasterListener,
public DeferredcasterListener
{
private:
inline static const GLenum ColorAttachment0Array[1] = {
GL_COLOR_ATTACHMENT0
};
inline static const GLenum ColorAttachment1Array[1] = {
GL_COLOR_ATTACHMENT1
};
inline static const GLenum ColorAttachment01Array[2] = {
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT1
};
inline static const GLenum ColorAttachment03Array[2] = {
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT3
};
inline static const GLenum ColorAttachment012Array[3] = {
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2
};
inline static const GLenum ColorAttachment0123Array[4] = {
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3
};
typedef struct {
GLuint _colorTexture;
GLuint _positionTexture;
GLuint _normalTexture;
GLuint _depthTexture;
GLuint _framebuffer;
} GBuffers;
typedef struct {
GLuint framebuffer;
GLuint colorTexture[2];
} PingPongBuffers;
typedef struct {
GLuint _hdrFilteringFramebuffer;
GLuint _hdrFilteringTexture;
} HDRBuffers;
typedef struct {
GLuint _fxaaFramebuffer;
GLuint _fxaaTexture;
} FXAABuffers;
public:
typedef std::map<
VolumeRaycaster*,
std::unique_ptr<ghoul::opengl::ProgramObject>
> RaycasterProgObjMap;
typedef std::map<
Deferredcaster*,
std::unique_ptr<ghoul::opengl::ProgramObject>
> DeferredcasterProgObjMap;
public:
virtual ~FramebufferRenderer() = default;
@@ -143,7 +79,7 @@ public:
void setSaturation(float sat) override;
void enableFXAA(bool enable) override;
void disableHDR(bool disable) override;
void setDisableHDR(bool disable) override;
void update() override;
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
@@ -162,10 +98,19 @@ public:
DeferredcasterListener::IsAttached isAttached) override;
private:
using RaycasterProgObjMap = std::map<
VolumeRaycaster*,
std::unique_ptr<ghoul::opengl::ProgramObject>
>;
using DeferredcasterProgObjMap = std::map<
Deferredcaster*,
std::unique_ptr<ghoul::opengl::ProgramObject>
>;
void resolveMSAA(float blackoutFactor);
void applyTMO(float blackoutFactor);
void applyFXAA();
private:
std::map<VolumeRaycaster*, RaycastData> _raycastData;
RaycasterProgObjMap _exitPrograms;
RaycasterProgObjMap _raycastPrograms;
@@ -191,11 +136,29 @@ private:
GLuint _exitDepthTexture;
GLuint _exitFramebuffer;
GBuffers _gBuffers;
PingPongBuffers _pingPongBuffers;
HDRBuffers _hdrBuffers;
FXAABuffers _fxaaBuffers;
struct {
GLuint colorTexture;
GLuint positionTexture;
GLuint normalTexture;
GLuint depthTexture;
GLuint framebuffer;
} _gBuffers;
struct {
GLuint framebuffer;
GLuint colorTexture[2];
} _pingPongBuffers;
struct {
GLuint hdrFilteringFramebuffer;
GLuint hdrFilteringTexture;
} _hdrBuffers;
struct {
GLuint fxaaFramebuffer;
GLuint fxaaTexture;
} _fxaaBuffers;
unsigned int _pingPongIndex = 0u;
bool _dirtyDeferredcastData;