29 #include "../shaders/WGEPropertyUniform.h"
30 #include "../shaders/WGEShaderPropertyDefineOptions.h"
32 #include "WGEPostprocessorMergeOp.h"
36 "MergeOp - combines all input textures in a user defined way." )
41 osg::ref_ptr< osg::Texture2D > tex0,
42 osg::ref_ptr< osg::Texture2D > tex1,
43 osg::ref_ptr< osg::Texture2D > tex2,
44 osg::ref_ptr< osg::Texture2D > tex3,
45 osg::ref_ptr< osg::Texture2D > tex4,
46 osg::ref_ptr< osg::Texture2D > tex5,
47 osg::ref_ptr< osg::Texture2D > tex6,
48 osg::ref_ptr< osg::Texture2D > tex7 ):
50 "MergeOp - combines all input textures in a user defined way." ),
63 osg::ref_ptr< WGEOffscreenTexturePass > pass = offscreen->addTextureProcessingPass(
m_mergeOpShader,
"MergeOp" );
68 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER0, GL_RGBA ) );
69 pass->bind( tex0, 0 );
75 pass->bind( tex1, 1 );
81 pass->bind( tex2, 2 );
87 pass->bind( tex3, 3 );
93 pass->bind( tex4, 4 );
99 pass->bind( tex5, 5 );
105 pass->bind( tex6, 6 );
111 pass->bind( tex7, 7 );
WGEShaderCodeInjector::SPtr m_codeInjector
This preprocessor handles insertion of the custom merge code.
WGEShader::RefPtr m_mergeOpShader
The shader used for merging.
void setGLSLMergeCode(std::string code)
Set the GLSL code inserted into the shader as merging operation.
virtual ~WGEPostprocessorMergeOp()
Destructor.
WGEPostprocessorMergeOp()
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.
This preprocessor is able to inject code into a shader.
Class encapsulating the OSG Program class for a more convenient way of adding and modifying shader.