28 #include "WGEPostprocessorEdgeEnhance.h"
29 #include "WGEPostprocessorCelShading.h"
30 #include "WGEPostprocessorGauss.h"
31 #include "WGEPostprocessorSSAO.h"
32 #include "WGEPostprocessorLineAO.h"
34 #include "WGEPostprocessor.h"
42 m_properties( boost::shared_ptr<
WProperties >( new
WProperties(
"Settings for " + name,
"Post-processing properties" ) ) ),
44 m_description( description )
47 m_effectOnly =
m_properties->addProperty(
"Effect Only",
"If active, the plain effect will be shown instead a combination of effect "
48 "and color. This settings does not affect all postprocessors.",
false );
49 m_effectScale =
m_properties->addProperty(
"Effect Scaling",
"Use this to overemphasize an effect or to weaken it. Technically spoken, this "
50 "factor determines the pre-multiplication done prior to blending with the input color.", 1.0,
57 "WGE_POSTPROCESSOR_OUTPUT_COMBINE",
"WGE_POSTPROCESSOR_OUTPUT_EFFECT_ONLY" ) );
94 m_colorTexture = from[0];
98 m_normalTexture = from[1];
100 if( from.size() > 2 )
102 m_parameterTexture = from[2];
104 if( from.size() > 3 )
106 m_tangentTexture = from[3];
108 if( from.size() > 4 )
115 osg::ref_ptr< osg::Texture2D > normal,
116 osg::ref_ptr< osg::Texture2D > parameter,
117 osg::ref_ptr< osg::Texture2D > tangent,
118 osg::ref_ptr< osg::Texture2D > depth ):
119 m_colorTexture( color ),
120 m_normalTexture( normal ),
121 m_parameterTexture( parameter ),
122 m_tangentTexture( tangent ),
131 buf.
m_normalTexture = from->attach( WGECamera::COLOR_BUFFER1, GL_RGB );
141 to->bind( m_colorTexture, 0 );
142 to->bind( m_normalTexture, 1 );
143 to->bind( m_parameterTexture, 2 );
145 to->bind( m_tangentTexture, 4 );
osg::ref_ptr< osg::Texture2D > m_depthTexture
Depth.
virtual const std::string getName() const
Gets the name of this postprocessor.
virtual bool getFixedViewportSize() const
When this returns true, the viewport size is fixed to the size of the target texture.
virtual osg::ref_ptr< osg::Texture2D > getOutput(size_t idx=0) const
Returns the result texture.
osg::ref_ptr< osg::Texture2D > m_parameterTexture
Some not yet defined parameter texture, LUMINANCE only.
This class encapsulates a G-Buffer.
std::string m_name
Name string.
WPropBool m_effectOnly
A flag denoting whether the effect should be combined with color or not.
std::vector< WGEPostprocessor::SPtr > ProcessorList
Type used for returning lists of postprocessor prototypes.
boost::shared_ptr< WGEPostprocessor > SPtr
Convenience typedef for an osg::ref_ptr< WGEPostprocessor >.
Gauss filtering of the input.
virtual const std::string getDescription() const
Gets the description for this postprocessor.
This is a WGEShaderDefineOptions class which additionally uses a property to automatically control th...
WGEPostprocessor(std::string name, std::string description)
Create named prototype.
WPropDouble m_effectScale
Scale the effect prior to blending it.
WGEShaderPreprocessor::SPtr m_effectOnlyPreprocessor
For convenience, this is a shader preprocessor controlled by m_effectOnly property.
Interface class for the concept "Prototype".
PostprocessorInput()
Constructor creates empty GBuffer.
static void initPostprocessors()
Needs to be called prior to any "getPostprocessors" call.
virtual osg::ref_ptr< osg::Texture2D > getDepth() const
Returns the new depth texture.
size_t bind(osg::ref_ptr< WGEOffscreenRenderPass > to) const
Attaches these textures to the specified renderpass.
osg::ref_ptr< osg::Texture2D > m_normalTexture
Normal in RGB.
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
Cel shading effect postprocessor.
static size_t addPostprocessor(SPtr processor)
Allows adding a postprocessor.
std::vector< osg::ref_ptr< osg::Texture2D > > m_resultTextures
The textures contain the result.
osg::ref_ptr< osg::Texture2D > m_depthTexture
The texture contains the new depth.
std::string m_description
Description string.
boost::shared_ptr< WGEShaderPreprocessor > SPtr
Shared pointer for this class.
const std::vector< osg::ref_ptr< osg::Texture2D > > & getOutputList() const
This processor can produce multiple outputs.
static PostprocessorInput attach(osg::ref_ptr< WGEOffscreenRenderPass > from)
Attaches the needed textures to the specified render pass and returns the G-Buffer.
osg::ref_ptr< osg::Texture2D > m_colorTexture
Color in RGBA.
virtual ~WGEPostprocessor()
Destructor.
static ProcessorList m_postProcessors
List of all postprocessors.
Edge enhancing postprocessor.
osg::ref_ptr< osg::Texture2D > m_tangentTexture
Tangent in RGB.
virtual WPropGroup getProperties() const
Returns the set of properties controlling the post-processing node.
static ProcessorList getPostprocessors()
Returns a list of all known postprocessor prototypes.
WPropGroup m_properties
All the properties of the post-processor.