OpenWalnut
1.3.1
|
The base class for all custom post-processors. More...
#include <WGEPostprocessor.h>
Classes | |
class | PostprocessorInput |
This class encapsulates a G-Buffer. More... | |
Public Types | |
typedef boost::shared_ptr < WGEPostprocessor > | SPtr |
Convenience typedef for an osg::ref_ptr< WGEPostprocessor >. More... | |
typedef boost::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 | |
WGEPostprocessor (std::string name, std::string description) | |
Create named prototype. More... | |
virtual | ~WGEPostprocessor () |
Destructor. More... | |
virtual SPtr | create (osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const =0 |
Create instance. 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... | |
![]() | |
WPrototyped () | |
Default constructor. More... | |
virtual | ~WPrototyped () |
Destructor. More... | |
template<typename T > | |
bool | isA () |
Checks whether the actual prototype has the specified runtime type. More... | |
Static Public Member Functions | |
static ProcessorList | getPostprocessors () |
Returns a list of all known postprocessor prototypes. More... | |
Protected Attributes | |
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... | |
WGEShaderPreprocessor::SPtr | m_effectOnlyPreprocessor |
For convenience, this is a shader preprocessor controlled by m_effectOnly property. More... | |
Private Attributes | |
std::string | m_name |
Name string. More... | |
std::string | m_description |
Description string. More... | |
The base class for all custom post-processors.
It allows building an own texture processing pipeline for special processings.
Definition at line 52 of file WGEPostprocessor.h.
typedef boost::shared_ptr< const WGEPostprocessor > WGEPostprocessor::ConstSPtr |
Convenience typedef for an osg::ref_ptr< const WGEPostprocessor >.
Definition at line 141 of file WGEPostprocessor.h.
typedef std::vector< WGEPostprocessor::SPtr > WGEPostprocessor::ProcessorList |
Type used for returning lists of postprocessor prototypes.
Definition at line 146 of file WGEPostprocessor.h.
typedef boost::shared_ptr< WGEPostprocessor > WGEPostprocessor::SPtr |
Convenience typedef for an osg::ref_ptr< WGEPostprocessor >.
Definition at line 136 of file WGEPostprocessor.h.
WGEPostprocessor::WGEPostprocessor | ( | std::string | name, |
std::string | description | ||
) |
Create named prototype.
You should call this in your prototype constructor.
name | name of processor |
description | description. |
Definition at line 36 of file WGEPostprocessor.cpp.
References m_effectOnly, m_effectOnlyPreprocessor, and m_properties.
|
virtual |
Destructor.
Definition at line 53 of file WGEPostprocessor.cpp.
|
pure virtual |
Create instance.
Uses the protected constructor. Implement it if you derive from this class! This is called whenever your postprocessor is applied to the standard render-output. You can add your own constructors and creators for other cases.
offscreen | use this offscreen node to add your texture pass' |
gbuffer | the input textures you should use |
Implemented in WGEPostprocessorMergeOp, WGEPostprocessorGauss, WGEPostprocessorLineAO, WGEPostprocessorSSAO, WGEPostprocessorCelShading, and WGEPostprocessorEdgeEnhance.
|
virtual |
Returns the new depth texture.
Allows you to modify the depth values. By default, this is NULL. Check this!
Definition at line 73 of file WGEPostprocessor.cpp.
References m_depthTexture.
|
virtual |
Gets the description for this postprocessor.
Implements WPrototyped.
Definition at line 160 of file WGEPostprocessor.cpp.
References m_description.
|
virtual |
Gets the name of this postprocessor.
Implements WPrototyped.
Definition at line 155 of file WGEPostprocessor.cpp.
References m_name.
|
virtual |
Returns the result texture.
Use this to continue processing.
idx | which output. Each postprocessor returns at least one texture in index 0, which also is the default value |
Definition at line 63 of file WGEPostprocessor.cpp.
References m_resultTextures.
const std::vector< osg::ref_ptr< osg::Texture2D > > & WGEPostprocessor::getOutputList | ( | ) | const |
This processor can produce multiple outputs.
Grab them here. This vector always contains at least the first filtered texture in unit 0.
Definition at line 68 of file WGEPostprocessor.cpp.
References m_resultTextures.
|
static |
Returns a list of all known postprocessor prototypes.
Definition at line 142 of file WGEPostprocessor.cpp.
Referenced by WGEPostprocessingNode::WGEPostprocessingNode().
|
virtual |
Returns the set of properties controlling the post-processing node.
You can use them to provide them to the user for example.
Definition at line 58 of file WGEPostprocessor.cpp.
References m_properties.
|
protected |
The texture contains the new depth.
Definition at line 230 of file WGEPostprocessor.h.
Referenced by WGEPostprocessor::PostprocessorInput::bind(), getDepth(), and WGEPostprocessor::PostprocessorInput::PostprocessorInput().
|
private |
Description string.
Set by the constructor.
Definition at line 255 of file WGEPostprocessor.h.
Referenced by getDescription().
|
protected |
A flag denoting whether the effect should be combined with color or not.
Definition at line 240 of file WGEPostprocessor.h.
Referenced by WGEPostprocessor(), and WGEPostprocessorCelShading::WGEPostprocessorCelShading().
|
protected |
For convenience, this is a shader preprocessor controlled by m_effectOnly property.
Definition at line 245 of file WGEPostprocessor.h.
Referenced by WGEPostprocessor(), WGEPostprocessorCelShading::WGEPostprocessorCelShading(), WGEPostprocessorEdgeEnhance::WGEPostprocessorEdgeEnhance(), WGEPostprocessorGauss::WGEPostprocessorGauss(), WGEPostprocessorLineAO::WGEPostprocessorLineAO(), WGEPostprocessorMergeOp::WGEPostprocessorMergeOp(), and WGEPostprocessorSSAO::WGEPostprocessorSSAO().
|
private |
Name string.
Set by the constructor.
Definition at line 250 of file WGEPostprocessor.h.
Referenced by getName().
|
protected |
All the properties of the post-processor.
Definition at line 235 of file WGEPostprocessor.h.
Referenced by getProperties(), WGEPostprocessor(), WGEPostprocessorCelShading::WGEPostprocessorCelShading(), WGEPostprocessorEdgeEnhance::WGEPostprocessorEdgeEnhance(), WGEPostprocessorLineAO::WGEPostprocessorLineAO(), and WGEPostprocessorSSAO::WGEPostprocessorSSAO().
|
protected |
The textures contain the result.
Add at least one result texture
Definition at line 225 of file WGEPostprocessor.h.
Referenced by getOutput(), getOutputList(), WGEPostprocessorCelShading::WGEPostprocessorCelShading(), WGEPostprocessorEdgeEnhance::WGEPostprocessorEdgeEnhance(), WGEPostprocessorGauss::WGEPostprocessorGauss(), WGEPostprocessorLineAO::WGEPostprocessorLineAO(), WGEPostprocessorMergeOp::WGEPostprocessorMergeOp(), and WGEPostprocessorSSAO::WGEPostprocessorSSAO().