OpenWalnut
1.4.0
|
MergeOp is a operator to merge multiple input texture. More...
#include <WGEPostprocessorMergeOp.h>
Public Types | |
typedef boost::shared_ptr < WGEPostprocessorMergeOp > | SPtr |
Convenience typedef for a boost::shared_ptr< WGEPostprocessorMergeOp >. | |
typedef boost::shared_ptr < const WGEPostprocessorMergeOp > | ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WGEPostprocessorMergeOp >. | |
Public Member Functions | |
WGEPostprocessorMergeOp () | |
Default constructor. | |
WGEPostprocessorMergeOp (osg::ref_ptr< WGEOffscreenRenderNode > offscreen, osg::ref_ptr< osg::Texture2D > tex0, osg::ref_ptr< osg::Texture2D > tex1=osg::ref_ptr< osg::Texture2D >(), osg::ref_ptr< osg::Texture2D > tex2=osg::ref_ptr< osg::Texture2D >(), osg::ref_ptr< osg::Texture2D > tex3=osg::ref_ptr< osg::Texture2D >(), osg::ref_ptr< osg::Texture2D > tex4=osg::ref_ptr< osg::Texture2D >(), osg::ref_ptr< osg::Texture2D > tex5=osg::ref_ptr< osg::Texture2D >(), osg::ref_ptr< osg::Texture2D > tex6=osg::ref_ptr< osg::Texture2D >(), osg::ref_ptr< osg::Texture2D > tex7=osg::ref_ptr< osg::Texture2D >()) | |
Constructor. | |
virtual | ~WGEPostprocessorMergeOp () |
Destructor. | |
virtual WGEPostprocessor::SPtr | create (osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const |
Create instance. | |
void | setGLSLMergeCode (std::string code) |
Set the GLSL code inserted into the shader as merging operation. | |
Private Attributes | |
WGEShader::RefPtr | m_mergeOpShader |
The shader used for merging. | |
WGEShaderCodeInjector::SPtr | m_codeInjector |
This preprocessor handles insertion of the custom merge code. |
MergeOp is a operator to merge multiple input texture.
The merge operation can be defined by the user.
Definition at line 42 of file WGEPostprocessorMergeOp.h.
typedef boost::shared_ptr< const WGEPostprocessorMergeOp > WGEPostprocessorMergeOp::ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WGEPostprocessorMergeOp >.
Reimplemented from WGEPostprocessor.
Definition at line 53 of file WGEPostprocessorMergeOp.h.
typedef boost::shared_ptr< WGEPostprocessorMergeOp > WGEPostprocessorMergeOp::SPtr |
Convenience typedef for a boost::shared_ptr< WGEPostprocessorMergeOp >.
Reimplemented from WGEPostprocessor.
Definition at line 48 of file WGEPostprocessorMergeOp.h.
Default constructor.
Definition at line 34 of file WGEPostprocessorMergeOp.cpp.
Referenced by create().
WGEPostprocessorMergeOp::WGEPostprocessorMergeOp | ( | osg::ref_ptr< WGEOffscreenRenderNode > | offscreen, |
osg::ref_ptr< osg::Texture2D > | tex0, | ||
osg::ref_ptr< osg::Texture2D > | tex1 = osg::ref_ptr< osg::Texture2D >() , |
||
osg::ref_ptr< osg::Texture2D > | tex2 = osg::ref_ptr< osg::Texture2D >() , |
||
osg::ref_ptr< osg::Texture2D > | tex3 = osg::ref_ptr< osg::Texture2D >() , |
||
osg::ref_ptr< osg::Texture2D > | tex4 = osg::ref_ptr< osg::Texture2D >() , |
||
osg::ref_ptr< osg::Texture2D > | tex5 = osg::ref_ptr< osg::Texture2D >() , |
||
osg::ref_ptr< osg::Texture2D > | tex6 = osg::ref_ptr< osg::Texture2D >() , |
||
osg::ref_ptr< osg::Texture2D > | tex7 = osg::ref_ptr< osg::Texture2D >() |
||
) |
Constructor.
We implement a public constructor which can take more textures as input
offscreen | use this offscreen node to add your texture pass' |
tex0 | texture to filter |
tex1 | texture to filter |
tex2 | texture to filter |
tex3 | texture to filter |
tex4 | texture to filter |
tex5 | texture to filter |
tex6 | texture to filter |
tex7 | texture to filter |
Definition at line 40 of file WGEPostprocessorMergeOp.cpp.
References m_codeInjector, WGEPostprocessor::m_effectOnlyPreprocessor, m_mergeOpShader, and WGEPostprocessor::m_resultTextures.
WGEPostprocessorMergeOp::~WGEPostprocessorMergeOp | ( | ) | [virtual] |
Destructor.
Definition at line 116 of file WGEPostprocessorMergeOp.cpp.
WGEPostprocessor::SPtr WGEPostprocessorMergeOp::create | ( | osg::ref_ptr< WGEOffscreenRenderNode > | offscreen, |
const PostprocessorInput & | gbuffer | ||
) | const [virtual] |
Create instance.
Uses the protected constructor. Implement it if you derive from this class!
offscreen | use this offscreen node to add your texture pass' |
gbuffer | the input textures you should use |
Implements WGEPostprocessor.
Definition at line 121 of file WGEPostprocessorMergeOp.cpp.
References WGEPostprocessor::PostprocessorInput::m_colorTexture, and WGEPostprocessorMergeOp().
void WGEPostprocessorMergeOp::setGLSLMergeCode | ( | std::string | code | ) |
Set the GLSL code inserted into the shader as merging operation.
If none was set, the mix command is used for each incoming texture. The code you write here should not make any assumptions to the environment it is inserted. What you have is a vec4 named color, initialized with vec4( 1.0 ). Set your final color to this vec4. It will be the result.
code | the code as string |
Definition at line 127 of file WGEPostprocessorMergeOp.cpp.
References m_codeInjector, and m_mergeOpShader.
This preprocessor handles insertion of the custom merge code.
Definition at line 116 of file WGEPostprocessorMergeOp.h.
Referenced by setGLSLMergeCode(), and WGEPostprocessorMergeOp().
The shader used for merging.
Definition at line 111 of file WGEPostprocessorMergeOp.h.
Referenced by setGLSLMergeCode(), and WGEPostprocessorMergeOp().