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_;
unsigned int rtSceneWidth_
scene render target width
QString description()
Return a description of what the plugin is doing.
void destroyResources()
free all gl resources
GLSL::Program * programs_[6]
shader programs
unsigned int glWidth_
viewer window width
Logtype
Log types for Message Window.
GLuint depthSSAORenderBuf_
depth renderbuffer for ssaoFbo
unsigned int rtWidth_
render target width
unsigned int rtDownWidth_
downsampled rt width
GLSL::Shader * shaders_[10]
shader resources
unsigned int rtDownHeight_
downsampled rt height
Interface for all Plugins which do logging to the logging window of the framework.
void traverseLightNodes(BaseNode *_node)
find all light nodes in the scene
GLuint depthBufTex_
depth buffer render target
GLuint downsampledTex_
downsampled depth render target
unsigned int glHeight_
viewer window height
GLuint randomVecTex_
random vector table for sample offset rotation
GLuint downsampledTmpTex_
downsampled temp rt for intermediate results
void generatePeelingShaders(GLSL::StringList *_strVertexShaderOut, GLSL::StringList *_strFragmentShaderOut, bool _textured)
peel shader generator based on lights and texture mode
void generateSamplingKernel()
computes a hemisphere sampling kernel in [0,1] range
void reloadResources(int _viewerId, unsigned int _sceneTexWidth, unsigned int _sceneTexHeight)
reload gl resources
A generic shader base class.
Interface class from which all plugins have to be created.
Interface to add additional rendering functions from within plugins.
ACG::Vec3f samplingKernel_[128]
ssao sampling kernel
GLuint sceneBufTex_
standard scene without a render target
unsigned int rtSceneHeight_
scene render target height
void drawScenePass(ACG::GLState *_glState, Viewer::ViewerProperties &_properties, BaseNode *_sceneGraphRoot)
draw the current scene
GLuint depthSceneRenderBuf_
depth renderbuffer for sceneFbo
GLuint occlusionTex_
occlusion render target
static const unsigned int numSamples_
number of samples
unsigned int rtHeight_
render target height
QString name()
Return a name for the plugin.
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)