OpenWalnut
1.5.0dev
|
MergeOp is a operator to merge multiple input texture. More...
#include <WGEPostprocessorMergeOp.h>
Public Types | |
typedef std::shared_ptr< WGEPostprocessorMergeOp > | SPtr |
Convenience typedef for a std::shared_ptr< WGEPostprocessorMergeOp >. More... | |
typedef std::shared_ptr< const WGEPostprocessorMergeOp > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WGEPostprocessorMergeOp >. More... | |
Public Types inherited from WGEPostprocessor | |
typedef std::shared_ptr< WGEPostprocessor > | SPtr |
Convenience typedef for an osg::ref_ptr< WGEPostprocessor >. More... | |
typedef std::shared_ptr< const WGEPostprocessor > | ConstSPtr |
Convenience typedef for an osg::ref_ptr< const WGEPostprocessor >. More... | |
typedef std::vector< WGEPostprocessor::SPtr > | ProcessorList |
Type used for returning lists of postprocessor prototypes. More... | |
Public Member Functions | |
WGEPostprocessorMergeOp () | |
Default constructor. More... | |
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. More... | |
virtual | ~WGEPostprocessorMergeOp () |
Destructor. More... | |
virtual WGEPostprocessor::SPtr | create (osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const |
Create instance. More... | |
void | setGLSLMergeCode (std::string code) |
Set the GLSL code inserted into the shader as merging operation. More... | |
Public Member Functions inherited from WGEPostprocessor | |
WGEPostprocessor (std::string name, std::string description) | |
Create named prototype. More... | |
virtual | ~WGEPostprocessor () |
Destructor. More... | |
virtual WPropGroup | getProperties () const |
Returns the set of properties controlling the post-processing node. More... | |
virtual osg::ref_ptr< osg::Texture2D > | getOutput (size_t idx=0) const |
Returns the result texture. More... | |
const std::vector< osg::ref_ptr< osg::Texture2D > > & | getOutputList () const |
This processor can produce multiple outputs. More... | |
virtual osg::ref_ptr< osg::Texture2D > | getDepth () const |
Returns the new depth texture. More... | |
virtual const std::string | getName () const |
Gets the name of this postprocessor. More... | |
virtual const std::string | getDescription () const |
Gets the description for this postprocessor. More... | |
virtual bool | getFixedViewportSize () const |
When this returns true, the viewport size is fixed to the size of the target texture. More... | |
Public Member Functions inherited from WPrototyped | |
WPrototyped () | |
Default constructor. More... | |
virtual | ~WPrototyped () |
Destructor. More... | |
template<typename T > | |
bool | isA () |
Checks whether the actual prototype has the specified runtime type. More... | |
Private Attributes | |
WGEShader::RefPtr | m_mergeOpShader |
The shader used for merging. More... | |
WGEShaderCodeInjector::SPtr | m_codeInjector |
This preprocessor handles insertion of the custom merge code. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from WGEPostprocessor | |
static ProcessorList | getPostprocessors () |
Returns a list of all known postprocessor prototypes. More... | |
static void | initPostprocessors () |
Needs to be called prior to any "getPostprocessors" call. More... | |
static size_t | addPostprocessor (SPtr processor) |
Allows adding a postprocessor. More... | |
Protected Attributes inherited from WGEPostprocessor | |
std::vector< osg::ref_ptr< osg::Texture2D > > | m_resultTextures |
The textures contain the result. More... | |
osg::ref_ptr< osg::Texture2D > | m_depthTexture |
The texture contains the new depth. More... | |
WPropGroup | m_properties |
All the properties of the post-processor. More... | |
WPropBool | m_effectOnly |
A flag denoting whether the effect should be combined with color or not. More... | |
WPropDouble | m_effectScale |
Scale the effect prior to blending it. More... | |
WGEShaderPreprocessor::SPtr | m_effectOnlyPreprocessor |
For convenience, this is a shader preprocessor controlled by m_effectOnly property. More... | |
MergeOp is a operator to merge multiple input texture.
The merge operation can be defined by the user.
Definition at line 40 of file WGEPostprocessorMergeOp.h.
typedef std::shared_ptr< const WGEPostprocessorMergeOp > WGEPostprocessorMergeOp::ConstSPtr |
Convenience typedef for a std::shared_ptr< const WGEPostprocessorMergeOp >.
Definition at line 51 of file WGEPostprocessorMergeOp.h.
typedef std::shared_ptr< WGEPostprocessorMergeOp > WGEPostprocessorMergeOp::SPtr |
Convenience typedef for a std::shared_ptr< WGEPostprocessorMergeOp >.
Definition at line 46 of file WGEPostprocessorMergeOp.h.
WGEPostprocessorMergeOp::WGEPostprocessorMergeOp | ( | ) |
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.
|
virtual |
Destructor.
Definition at line 116 of file WGEPostprocessorMergeOp.cpp.
|
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.
|
private |
This preprocessor handles insertion of the custom merge code.
Definition at line 114 of file WGEPostprocessorMergeOp.h.
Referenced by setGLSLMergeCode(), and WGEPostprocessorMergeOp().
|
private |
The shader used for merging.
Definition at line 109 of file WGEPostprocessorMergeOp.h.
Referenced by setGLSLMergeCode(), and WGEPostprocessorMergeOp().