OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Attributes
WGEPostprocessorMergeOp Class Reference

MergeOp is a operator to merge multiple input texture. More...

#include <WGEPostprocessorMergeOp.h>

+ Inheritance diagram for WGEPostprocessorMergeOp:

List of all members.

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.

Detailed Description

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.


Member Typedef Documentation

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.

Convenience typedef for a boost::shared_ptr< WGEPostprocessorMergeOp >.

Reimplemented from WGEPostprocessor.

Definition at line 48 of file WGEPostprocessorMergeOp.h.


Constructor & Destructor Documentation

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

Parameters:
offscreenuse this offscreen node to add your texture pass'
tex0texture to filter
tex1texture to filter
tex2texture to filter
tex3texture to filter
tex4texture to filter
tex5texture to filter
tex6texture to filter
tex7texture to filter

Definition at line 40 of file WGEPostprocessorMergeOp.cpp.

References m_codeInjector, WGEPostprocessor::m_effectOnlyPreprocessor, m_mergeOpShader, and WGEPostprocessor::m_resultTextures.

Destructor.

Definition at line 116 of file WGEPostprocessorMergeOp.cpp.


Member Function Documentation

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!

Parameters:
offscreenuse this offscreen node to add your texture pass'
gbufferthe input textures you should use
Returns:
shared pointer to the created insteance

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.

Parameters:
codethe code as string

Definition at line 127 of file WGEPostprocessorMergeOp.cpp.

References m_codeInjector, and m_mergeOpShader.


Member Data Documentation

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().


The documentation for this class was generated from the following files: