Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DepthPeeling Class Reference
Inheritance diagram for DepthPeeling:
BaseInterface RenderInterface LoggingInterface ACG::IRenderer


struct  ViewerResources
 Collection of framebuffers for each viewport. More...

Public Slots

QString version ()


void log (Logtype _type, QString _message)
void log (QString _message)
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application. More...
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot. More...
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer. More...
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
virtual void log (QString _message)=0

Public Member Functions

QString name ()
 Return a name for the plugin. More...
QString description ()
 Return a description of what the plugin is doing. More...
void addRenderObject (ACG::RenderObject *_renderObject)
 overide addRenderObject function to include OIT check
QString renderObjectsInfo (bool _outputShaderInfo)
 Return a qstring of the current render objects. More...
QAction * optionsAction ()
 Return options menu. More...

Private Slots

void initializePlugin ()
void exit ()
void render (ACG::GLState *_glState, Viewer::ViewerProperties &_properties)
QString rendererName ()
void supportedDrawModes (ACG::SceneGraph::DrawModes::DrawMode &_mode)
QString checkOpenGL ()
void slotModeChanged (QAction *)

Private Member Functions

void renderFrontPeeling (ACG::GLState *_glState, Viewer::ViewerProperties &_properties)
 peel the scene from front to back, one layer per pass
void renderDualPeeling (ACG::GLState *_glState, Viewer::ViewerProperties &_properties)
 peel the scene with dual depth peeling, two layers per pass
void initDepthPeeling ()
 Allocate framebuffers and load shaders for depth-peeling.
void initDualDepthPeeling ()
 Allocate framebuffers and load shaders for dual-depth-peeling.
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
virtual ~BaseInterface ()
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates. More...
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin. More...
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin. More...
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden. More...
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
- Private Member Functions inherited from RenderInterface
virtual ~RenderInterface ()
virtual void reloadShaders ()
 Reload any renderer specific shaders. More...
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
- Private Member Functions inherited from ACG::IRenderer
virtual void addLight (const LightData &_light)
 Callback for the scenegraph nodes, which send new lights to the renderer via this function. More...
void dumpRenderObjectsToFile (const char *_fileName, ACG::RenderObject **_sortedList=0) const
 Debugging function to dump list of render objects into a file. More...
virtual QString dumpCurrentRenderObjectsToString (ACG::RenderObject **_list=0, bool _outputShaders=false, std::vector< ACG::ShaderModifier * > *_modifiers=0)
 Outputs the current render objects to the string. More...
void setErrorDetectionLevel (int _level)
 Control error detection for checking render objects. More...
int getErrorDetectionLevel () const
 Get error detection level.
void setViewerID (int _viewerID)
 Set currently active viewer id. More...
virtual void prepareRenderingPipeline (ACG::GLState *_glState, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ACG::SceneGraph::BaseNode *_scenegraphRoot)
 Prepares renderer and OpenGL for any draw-related calls including. More...
virtual void collectRenderObjects (ACG::GLState *_glState, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ACG::SceneGraph::BaseNode *_sceneGraphRoot)
 Traverse the scenegraph to collect render information. More...
void traverseRenderableNodes (ACG::GLState *_glState, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ACG::SceneGraph::BaseNode *_node, const ACG::SceneGraph::Material *_mat)
 Scene graph traversal for render object collection. More...
virtual void sortRenderObjects ()
 Sort the renderobjects by priority. More...
virtual void renderObject (ACG::RenderObject *_obj, GLSL::Program *_prog=0, bool _constRenderStates=false, const std::vector< unsigned int > *_shaderModifiers=0)
 Render one renderobject. More...
virtual void bindObjectVBO (ACG::RenderObject *_obj, GLSL::Program *_prog)
 Binding VBOs (First state function) More...
virtual void bindObjectUniforms (ACG::RenderObject *_obj, GLSL::Program *_prog)
 Binding Uniforms (Second state function) More...
virtual void bindObjectRenderStates (ACG::RenderObject *_obj)
 Binding Render state (Third state function) More...
virtual void drawObject (ACG::RenderObject *_obj)
 Executes the opengl draw call for one object (Fourth function) More...
virtual void finishRenderingPipeline (bool _drawOverlay=true)
 Draw overlay objects and reset OpenGL state. More...
virtual void saveInputFbo ()
 Save input Fbo configuration (fbo id + viewport)
virtual void restoreInputFbo ()
 Restore the previously saved input Fbo configuration (fbo id + viewport)
virtual void saveActiveFbo (GLint *_outFboId, GLint *_outViewport, GLint *_outDrawBuffer) const
 Save active Fbo configuration (fbo id + viewport) More...
virtual void restoreFbo (GLint _fboId, const GLint *_outViewport, GLint _drawBuffer) const
 Restore a previously saved input Fbo configuration (fbo id + viewport) More...
virtual void clearInputFbo (const ACG::Vec4f &_clearColor)
 Clear input Fbo. More...
virtual void copyDepthToBackBuffer (GLuint _depthTex, float _scale=1.0f)
 Copy texture to depth buffer. More...
virtual void renderDepthMap (int _viewerID, int _width, int _height)
 Render the depth map of the scene. More...
int getNumRenderObjects () const
 Get the number of collected render objects (not including overlay objects or gl4.2 line objects)
int getNumOverlayObjects () const
 Get the number of render objects in the overlay (for instance objects from coordsys are overlayed)
int getNumLineGL42Objects () const
 Get the number of default line objects rendered with opengl 4.2.
int getNumLights () const
 Get the number of current light sources.
ACG::RenderObjectgetRenderObject (int i)
 Get render objects in the sorted list by index (not including overlay objects)
ACG::RenderObjectgetOverlayRenderObject (int i)
 Get render objects in the sorted list by index (only overlay objects)
ACG::RenderObjectgetLineGL42RenderObject (int i)
 Get render objects in the sorted list by index (only line objects rendered with gl4.2)
LightDatagetLight (int i)
 Get light by index.
const ACG::Vec3fgetGlobalAmbientScale () const
 Get global ambient light contribution from GL_LIGHT_MODEL_AMBIENT.
void setLineThicknessRenderingGL42 (bool _enable)

Private Attributes

int peelMode_
 mode: 0 -> front to back peeling, 1 -> dual peeling
bool copyFrontDepth_
int maxPeelCount_
 max peel count
 blends one depth-layer into the current scene target
 final copy into back-buffer
GLuint peelQueryID_
 occlusion query determining end of peeling (last layer)
 dual depth peeling shaders
std::map< int, ViewerResourcesviewerRes_
- Private Attributes inherited from ACG::IRenderer
int numLights_
 Number of Lights.
LightData lights_ [SG_MAX_SHADER_LIGHTS]
 Light sources ( Filled by addLight() )
ACG::Vec3f globalLightModelAmbient_
std::vector< ACG::RenderObjectrenderObjects_
 array of renderobjects, filled by addRenderObject()
std::vector< ACG::RenderObject * > sortedObjects_
 sorted list of renderobjects without overlay objects (sorted in rendering order)
std::vector< ACG::RenderObject * > overlayObjects_
 sorted list of overlay-only renderobjects (sorted in rendering order)
std::map< int, ACG::FBO * > depthMaps_
bool depthMapUsed_
 true if at least one renderobject requires a scene depthmap, false otherwise
int curViewerID_
 currently active viewer ID as specified in prepareRenderObjects()
GLMatrixf viewMatrix_
 view transform
Vec3f camPosWS_
 cam position in world-space
Vec3f camDirWS_
 direction the camera is looking to in world-space
GLint prevFbo_
 previous fbo
GLint prevDrawBuffer_
 previous drawbuffer target (ie GL_BACK, GL_COLOR_ATTACHMENTi...)
GLint prevViewport_ [4]
 previous viewport
bool prevFboSaved_
 flag indicating a that saveCurrentFbo() has been called prior restoreFbo()
 shader copies depth of the first front layer to the back buffer
int errorDetectionLevel_
 error-detection level for checking render objects

Additional Inherited Members

- Static Private Member Functions inherited from ACG::IRenderer
static int cmpPriority (const void *, const void *)
 Compare priority of render objects. More...

Detailed Description

Definition at line 57 of file DepthPeeling.hh.

Member Function Documentation

QString DepthPeeling::description ( )

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implements BaseInterface.

Definition at line 79 of file DepthPeeling.hh.

QString DepthPeeling::name ( )

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 78 of file DepthPeeling.hh.

QAction * DepthPeeling::optionsAction ( )

Return options menu.

If you want an options Menu or menu entry, you can return your action here. It will be shown on top of the renderer list in the options menu.

Action for a menu or menu entry

Reimplemented from RenderInterface.

Definition at line 60 of file

QString DepthPeeling::renderObjectsInfo ( bool  _outputShaderInfo)

Return a qstring of the current render objects.

In this function your plugin should return a list of the render objects (possibly with additional information). It can be used for debugging purposes.

The IRenderer class already has a function called dumpCurrentRenderObjectsToString() which can be used to implement this function.

_outputShaderInfoOutput shader code along with the render objects
string of render objects

Reimplemented from RenderInterface.

Definition at line 1029 of file

Member Data Documentation

std::map<int, ViewerResources> DepthPeeling::viewerRes_

Stores framebuffer resources for each viewport. Mapping: viewerID -> ViewerResources

Definition at line 188 of file DepthPeeling.hh.

The documentation for this class was generated from the following files: