27 #include "../shaders/WGEPropertyUniform.h"
28 #include "../shaders/WGEShaderPropertyDefineOptions.h"
30 #include "WGEPostprocessorGauss.h"
34 "Gauss filter all specified input textures." )
39 osg::ref_ptr< osg::Texture2D > tex0,
40 osg::ref_ptr< osg::Texture2D > tex1,
41 osg::ref_ptr< osg::Texture2D > tex2,
42 osg::ref_ptr< osg::Texture2D > tex3,
43 osg::ref_ptr< osg::Texture2D > tex4,
44 osg::ref_ptr< osg::Texture2D > tex5,
45 osg::ref_ptr< osg::Texture2D > tex6,
46 osg::ref_ptr< osg::Texture2D > tex7 ):
48 "Gauss filter all specified input textures." )
52 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS" );
58 osg::ref_ptr< WGEOffscreenTexturePass > pass = offscreen->addTextureProcessingPass( s,
"Gauss Filter" );
63 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER0, GL_RGBA ) );
64 pass->bind( tex0, 0 );
65 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT0" );
70 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER1, GL_RGBA ) );
71 pass->bind( tex1, 1 );
72 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT1" );
77 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER2, GL_RGBA ) );
78 pass->bind( tex2, 2 );
79 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT2" );
84 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER3, GL_RGBA ) );
85 pass->bind( tex3, 3 );
86 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT3" );
91 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER4, GL_RGBA ) );
92 pass->bind( tex4, 4 );
93 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT4" );
98 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER5, GL_RGBA ) );
99 pass->bind( tex5, 5 );
100 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT5" );
105 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER6, GL_RGBA ) );
106 pass->bind( tex6, 6 );
107 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT6" );
112 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER7, GL_RGBA ) );
113 pass->bind( tex7, 7 );
114 s->setDefine(
"WGE_POSTPROCESSOR_GAUSS_UNIT7" );
virtual ~WGEPostprocessorGauss()
Destructor.
WGEPostprocessorGauss()
Default constructor.
virtual WGEPostprocessor::SPtr create(osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const
Create instance.
This class encapsulates a G-Buffer.
osg::ref_ptr< osg::Texture2D > m_colorTexture
Color in RGBA.
The base class for all custom post-processors.
WGEShaderPreprocessor::SPtr m_effectOnlyPreprocessor
For convenience, this is a shader preprocessor controlled by m_effectOnly property.
std::shared_ptr< WGEPostprocessor > SPtr
Convenience typedef for an osg::ref_ptr< WGEPostprocessor >.
std::vector< osg::ref_ptr< osg::Texture2D > > m_resultTextures
The textures contain the result.
Class encapsulating the OSG Program class for a more convenient way of adding and modifying shader.
osg::ref_ptr< WGEShader > RefPtr
Convenience typedef for an osg::ref_ptr.