61 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-Render-SSAO")
66 void log(
Logtype _type, QString _message);
67 void log(QString _message);
75 QString
name() {
return (QString(
"SSAO Plugin")); };
76 QString
description( ) {
return (QString(tr(
"Screen Space Ambient Occlusion"))); };
79 QString version() {
return QString(
"1.0"); };
84 void initializePlugin();
89 QString rendererName();
91 QString checkOpenGL();
102 void reloadResources(
int _viewerId,
unsigned int _sceneTexWidth,
unsigned int _sceneTexHeight);
106 float _w = 2.0f,
float _h = 2.0f);
113 GLSL::StringList* _strFragmentShaderOut,
bool _textured);
120 void gaussianBlurPass(
const ViewerResources* _pViewer,
const float* _texelSize,
121 GLenum _targetAttachement, GLuint _srcTexture);
190 std::map<int, ViewerResources> viewerRes_;
Logtype
Log types for Message Window.
Interface class from which all plugins have to be created.
A generic shader base class.
Interface for all Plugins which do logging to the logging window of the framework.
Interface to add additional rendering functions from within plugins.
static const unsigned int numSamples_
number of samples
GLuint randomVecTex_
random vector table for sample offset rotation
void generatePeelingShaders(GLSL::StringList *_strVertexShaderOut, GLSL::StringList *_strFragmentShaderOut, bool _textured)
peel shader generator based on lights and texture mode
QString description()
Return a description of what the plugin is doing.
void drawScenePass(ACG::GLState *_glState, Viewer::ViewerProperties &_properties, BaseNode *_sceneGraphRoot)
draw the current scene
void destroyResources()
free all gl resources
void reloadResources(int _viewerId, unsigned int _sceneTexWidth, unsigned int _sceneTexHeight)
reload gl resources
ACG::Vec3f samplingKernel_[128]
ssao sampling kernel
GLSL::Shader * shaders_[10]
shader resources
void generateSamplingKernel()
computes a hemisphere sampling kernel in [0,1] range
QString name()
Return a name for the plugin.
GLSL::Program * programs_[6]
shader programs
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
GLuint depthSceneRenderBuf_
depth renderbuffer for sceneFbo
GLuint depthBufTex_
depth buffer render target
unsigned int rtHeight_
render target height
GLuint downsampledTex_
downsampled depth render target
unsigned int rtDownWidth_
downsampled rt width
unsigned int rtSceneWidth_
scene render target width
unsigned int rtDownHeight_
downsampled rt height
unsigned int rtSceneHeight_
scene render target height
GLuint downsampledTmpTex_
downsampled temp rt for intermediate results
GLuint occlusionTex_
occlusion render target
GLuint depthSSAORenderBuf_
depth renderbuffer for ssaoFbo
GLuint sceneBufTex_
standard scene without a render target
unsigned int glWidth_
viewer window width
unsigned int glHeight_
viewer window height
unsigned int rtWidth_
render target width