ImFusion SDK 4.3
GlVolumeView::RenderBufferWrapper Class Referenceabstract

#include <ImFusion/GL/GlVolumeView.h>

Helper class to allow the injection of custom render buffers surrounding the entire render pipeline. More...

Detailed Description

Helper class to allow the injection of custom render buffers surrounding the entire render pipeline.

If such an wrapper is defined and applied to the volume view, the rendering pipeline executes as follows:

  • createRenderBuffer() is called before the final rendering pass to the parent view. This allows to instantiate a new RenderBuffer.
  • The final rendering pass is computed, effectively rendering into the render buffer.
  • drawAndBlendToParent() is called. Here, a custom shader can be executed to modify the rendering, before actually blending the buffer to the parent.

Example usage:

class GlPlaneLineRendering : public GlRenderBufferWrapper
{
public:
...
void createRenderBuffer(const GlView& view) override
{
}
void drawAndBlendToParent(const GlView& view) override
{
glDisable(GL_DEPTH_TEST);
m_prog->enable();
...
m_prog->disable();
guard.restoreState(GL::StateGuard::DepthTest);
glEnable(GL_DEPTH_TEST);
m_renderBuffer.reset();
}
private:
};
Helper class to configure the OpenGL blending stage.
Definition Blending.h:46
@ AlphaBlending
Enables blending and sets (Function::SrcAlpha, Function::OneMinusSrcAlpha, Function::One,...
Definition Blending.h:52
static OffscreenRenderHelper & cachedInstance()
Definition InstanceManager.h:80
@ DivideBySqrtAlpha
Divide the RGBA value by sqrt(A).
Definition OffscreenRenderHelper.h:51
Guard to easily save and restore critical (modern) OpenGL state.
Definition StateGuard.h:40
@ DepthTest
Save the GL_DEPTH_TEST, glDepthMask and glDepthFunc states.
Definition StateGuard.h:49
const Viewport & viewport() const
Returns the viewport.
Definition ViewState.h:46
const GL::ViewState & state() const
Return the view state that was set during the last render() call.
Definition GlView.h:115
T make_unique(T... args)
vec2i size() const
Return the dimensions of the viewport as vec2i.
Definition Types.h:176

Public Member Functions

virtual void createRenderBuffer (const GlView &view)=0
 
virtual void drawAndBlendToParent (const GlView &view)=0
 

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close