Developer Documentation
Loading...
Searching...
No Matches
DepthPeelingPlugin Class Reference
Inheritance diagram for DepthPeelingPlugin:
BaseInterface RenderInterface LoggingInterface

Classes

struct  ViewerResources
 

Public Slots

QString version ()
 

Signals

void log (Logtype _type, QString _message)
 
void log (QString _message)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application.
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot.
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer.
 
- 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.
 
QString description ()
 Return a description of what the plugin is doing.
 

Private Types

enum  {
  PEEL_SHADER_WIREFRAME = 0 , PEEL_SHADER_HIDDENLINE = 1 , PEEL_SHADER_TEXTURED = 0x1 , PEEL_SHADER_PHONG = 0x2 ,
  PEEL_SHADER_GOURAUD = 0x4 , PEEL_SHADER_FLAT = 0x8 , PEEL_SHADER_VERTEXCOLORS = 0x10 , PEEL_NUM_COMBINATIONS = 0x20 ,
  PEEL_SHADER_NUM_FLAGS = 5
}
 
enum  LightType { LIGHTTYPE_DIRECTIONAL = 0 , LIGHTTYPE_POINT , LIGHTTYPE_SPOT }
 light type enumeration 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 ()
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin.
 
- Private Slots inherited from RenderInterface
virtual void render (ACG::GLState *_glState, Viewer::ViewerProperties &_properties)
 rendering function
 

Private Member Functions

void destroyResources ()
 free all gl resources
 
void destroyResources (int _viewerId)
 free viewer specific gl resources
 
void reloadResources (int _viewerId)
 reload gl resources
 
void drawQuadProj (float _x0=-1.0f, float _y0=1.0f, float _w=2.0f, float _h=2.0f)
 draw a quad in projection space (only positions)
 
void traverseLightNodes (BaseNode *_node)
 find all light nodes in the scene
 
void generatePeelingShaders (GLSL::StringList *_strVertexShaderOut, GLSL::StringList *_strFragmentShaderOut, GLSL::StringList *_strGeometryShaderOut, bool _textured, bool _flatShaded, bool _phong, bool _vertexColor, bool _wireFrame)
 peel shader generator based on lights and texture mode
 
void updatePeelingShaderSet ()
 regenerates peeling shaders based on light nodes in scenegraph
 
void drawScenePass (ACG::GLState *_glState, ACG::SceneGraph::DrawModes::DrawMode _drawMode, BaseNode *_sceneGraphRoot)
 draw the current scene
 
void drawScenePeelPass (ACG::GLState *_glState, ACG::SceneGraph::DrawModes::DrawMode _drawMode, BaseNode *_sceneGraphRoot, int _peelPass)
 
template<class Action >
void traverseDraw (BaseNode *_node, Action &_action, ACG::SceneGraph::DrawModes::DrawMode _globalDrawMode, int _pass, int _peelPass)
 
template<class Action >
bool traverseDrawApplyAction (BaseNode *_node, Action &_action, ACG::SceneGraph::DrawModes::DrawMode _globalDrawMode, int _pass, int _peelPass)
 
unsigned int getPeelShaderIndex (ACG::SceneGraph::DrawModes::DrawMode _drawMode)
 converts a drawmode to the correct shading program index
 
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor.
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates.
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin.
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin.
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden.
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer.
 
- Private Member Functions inherited from RenderInterface
virtual ~RenderInterface ()
 Destructor.
 
virtual QAction * optionsAction ()
 Return options menu.
 
virtual QString renderObjectsInfo (bool _outputShaderInfo)
 Return a qstring of the current render objects.
 
virtual void reloadShaders ()
 Reload any renderer specific shaders.
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 

Private Attributes

std::map< int, ViewerResourcesviewerRes_
 
GLSL::ShaderblendShaders_ [8]
 shader resources
 
GLSL::ProgramblendDualPeelProg_ [4]
 depth peeling programs
 
GLSL::ShaderpeelShaders_ [PEEL_NUM_COMBINATIONS *3]
 generated shader set
 
GLSL::ProgrampeelProgs_ [PEEL_NUM_COMBINATIONS]
 generates shader programs
 
GLuint blendQueryID_
 fragment query
 
ACG::GLStateglStateTmp_
 current glState ptr for hiddenline rendering
 
GLuint numLights_
 number of used lights in the scene
 
LightType lightTypes_ [16]
 registered lights in the scene
 
GLuint glLightIDs_ [16]
 matching GL light id
 

Detailed Description

Definition at line 55 of file ClassicDepthPeeling.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Definition at line 167 of file ClassicDepthPeeling.hh.

◆ LightType

light type enumeration

Definition at line 195 of file ClassicDepthPeeling.hh.

Constructor & Destructor Documentation

◆ DepthPeelingPlugin()

DepthPeelingPlugin::DepthPeelingPlugin ( )

Definition at line 55 of file ClassicDepthPeeling.cc.

◆ ~DepthPeelingPlugin()

DepthPeelingPlugin::~DepthPeelingPlugin ( )

Definition at line 82 of file ClassicDepthPeeling.cc.

Member Function Documentation

◆ checkOpenGL

QString DepthPeelingPlugin::checkOpenGL ( )
privateslot

Definition at line 1090 of file ClassicDepthPeeling.cc.

◆ description()

QString DepthPeelingPlugin::description ( )
inlinevirtual

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 76 of file ClassicDepthPeeling.hh.

◆ destroyResources() [1/2]

void DepthPeelingPlugin::destroyResources ( )
private

free all gl resources

Definition at line 186 of file ClassicDepthPeeling_glew.cc.

◆ destroyResources() [2/2]

void DepthPeelingPlugin::destroyResources ( int  _viewerId)
private

free viewer specific gl resources

Definition at line 175 of file ClassicDepthPeeling_glew.cc.

◆ drawQuadProj()

void DepthPeelingPlugin::drawQuadProj ( float  _x0 = -1.0f,
float  _y0 = 1.0f,
float  _w = 2.0f,
float  _h = 2.0f 
)
private

draw a quad in projection space (only positions)

Definition at line 134 of file ClassicDepthPeeling.cc.

◆ drawScenePass()

void DepthPeelingPlugin::drawScenePass ( ACG::GLState _glState,
ACG::SceneGraph::DrawModes::DrawMode  _drawMode,
BaseNode _sceneGraphRoot 
)
private

draw the current scene

Definition at line 816 of file ClassicDepthPeeling.cc.

◆ drawScenePeelPass()

void DepthPeelingPlugin::drawScenePeelPass ( ACG::GLState _glState,
ACG::SceneGraph::DrawModes::DrawMode  _drawMode,
BaseNode _sceneGraphRoot,
int  _peelPass 
)
private

Definition at line 790 of file ClassicDepthPeeling.cc.

◆ exit

void DepthPeelingPlugin::exit ( )
privateslot

Definition at line 114 of file ClassicDepthPeeling.cc.

◆ generatePeelingShaders()

void DepthPeelingPlugin::generatePeelingShaders ( GLSL::StringList *  _strVertexShaderOut,
GLSL::StringList *  _strFragmentShaderOut,
GLSL::StringList *  _strGeometryShaderOut,
bool  _textured,
bool  _flatShaded,
bool  _phong,
bool  _vertexColor,
bool  _wireFrame 
)
private

peel shader generator based on lights and texture mode

Definition at line 222 of file ClassicDepthPeeling.cc.

◆ getPeelShaderIndex()

unsigned int DepthPeelingPlugin::getPeelShaderIndex ( ACG::SceneGraph::DrawModes::DrawMode  _drawMode)
private

converts a drawmode to the correct shading program index

Definition at line 1057 of file ClassicDepthPeeling.cc.

◆ initializePlugin

void DepthPeelingPlugin::initializePlugin ( )
privateslot

Definition at line 98 of file ClassicDepthPeeling.cc.

◆ name()

QString DepthPeelingPlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 75 of file ClassicDepthPeeling.hh.

◆ reloadResources()

void DepthPeelingPlugin::reloadResources ( int  _viewerId)
private

reload gl resources

Definition at line 50 of file ClassicDepthPeeling_glew.cc.

◆ render

void DepthPeelingPlugin::render ( ACG::GLState _glState,
Viewer::ViewerProperties _properties 
)
privateslot

Definition at line 220 of file ClassicDepthPeeling_glew.cc.

◆ rendererName

QString DepthPeelingPlugin::rendererName ( )
privateslot

Definition at line 121 of file ClassicDepthPeeling.cc.

◆ supportedDrawModes

void DepthPeelingPlugin::supportedDrawModes ( ACG::SceneGraph::DrawModes::DrawMode _mode)
privateslot

Definition at line 127 of file ClassicDepthPeeling.cc.

◆ traverseDraw()

template<class Action >
void DepthPeelingPlugin::traverseDraw ( BaseNode _node,
Action &  _action,
ACG::SceneGraph::DrawModes::DrawMode  _globalDrawMode,
int  _pass,
int  _peelPass 
)
private

Definition at line 736 of file ClassicDepthPeeling.cc.

◆ traverseDrawApplyAction()

template<class Action >
bool DepthPeelingPlugin::traverseDrawApplyAction ( BaseNode _node,
Action &  _action,
ACG::SceneGraph::DrawModes::DrawMode  _globalDrawMode,
int  _pass,
int  _peelPass 
)
private

Definition at line 622 of file ClassicDepthPeeling.cc.

◆ traverseLightNodes()

void DepthPeelingPlugin::traverseLightNodes ( BaseNode _node)
private

find all light nodes in the scene

Definition at line 153 of file ClassicDepthPeeling.cc.

◆ updatePeelingShaderSet()

void DepthPeelingPlugin::updatePeelingShaderSet ( )
private

regenerates peeling shaders based on light nodes in scenegraph

Definition at line 824 of file ClassicDepthPeeling.cc.

◆ version

QString DepthPeelingPlugin::version ( )
inlineslot

Definition at line 79 of file ClassicDepthPeeling.hh.

Member Data Documentation

◆ blendDualPeelProg_

GLSL::Program* DepthPeelingPlugin::blendDualPeelProg_[4]
private

depth peeling programs

Definition at line 163 of file ClassicDepthPeeling.hh.

◆ blendQueryID_

GLuint DepthPeelingPlugin::blendQueryID_
private

fragment query

Definition at line 186 of file ClassicDepthPeeling.hh.

◆ blendShaders_

GLSL::Shader* DepthPeelingPlugin::blendShaders_[8]
private

shader resources

Definition at line 160 of file ClassicDepthPeeling.hh.

◆ glLightIDs_

GLuint DepthPeelingPlugin::glLightIDs_[16]
private

matching GL light id

Definition at line 205 of file ClassicDepthPeeling.hh.

◆ glStateTmp_

ACG::GLState* DepthPeelingPlugin::glStateTmp_
private

current glState ptr for hiddenline rendering

Definition at line 189 of file ClassicDepthPeeling.hh.

◆ lightTypes_

LightType DepthPeelingPlugin::lightTypes_[16]
private

registered lights in the scene

Definition at line 203 of file ClassicDepthPeeling.hh.

◆ numLights_

GLuint DepthPeelingPlugin::numLights_
private

number of used lights in the scene

Definition at line 192 of file ClassicDepthPeeling.hh.

◆ peelProgs_

GLSL::Program* DepthPeelingPlugin::peelProgs_[PEEL_NUM_COMBINATIONS]
private

generates shader programs

Definition at line 183 of file ClassicDepthPeeling.hh.

◆ peelShaders_

GLSL::Shader* DepthPeelingPlugin::peelShaders_[PEEL_NUM_COMBINATIONS *3]
private

generated shader set

Definition at line 180 of file ClassicDepthPeeling.hh.

◆ viewerRes_

std::map<int, ViewerResources> DepthPeelingPlugin::viewerRes_
private

Definition at line 157 of file ClassicDepthPeeling.hh.


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