25 #ifndef WGEPOSTPROCESSOR_H
26 #define WGEPOSTPROCESSOR_H
31 #include <boost/shared_ptr.hpp>
33 #include <osg/ref_ptr>
36 #include <osg/Texture>
38 #include "../offscreen/WGEOffscreenRenderNode.h"
39 #include "../offscreen/WGEOffscreenRenderPass.h"
40 #include "../offscreen/WGEOffscreenFinalPass.h"
42 #include "../shaders/WGEShaderPropertyDefineOptions.h"
43 #include "../WGECamera.h"
45 #include "../../common/WProperties.h"
46 #include "../../common/WPrototyped.h"
78 osg::ref_ptr< osg::Texture2D > normal,
79 osg::ref_ptr< osg::Texture2D > parameter,
80 osg::ref_ptr< osg::Texture2D > tangent,
81 osg::ref_ptr< osg::Texture2D > depth );
104 size_t bind( osg::ref_ptr< WGEOffscreenRenderPass > to )
const;
135 typedef boost::shared_ptr< WGEPostprocessor >
SPtr;
140 typedef boost::shared_ptr< const WGEPostprocessor >
ConstSPtr;
205 virtual osg::ref_ptr< osg::Texture2D >
getOutput(
size_t idx = 0 )
const;
212 const std::vector< osg::ref_ptr< osg::Texture2D > >&
getOutputList()
const;
219 virtual osg::ref_ptr< osg::Texture2D >
getDepth()
const;
226 virtual const std::string
getName()
const;
292 #endif // WGEPOSTPROCESSOR_H
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 >.
virtual const std::string getDescription() const
Gets the description for this postprocessor.
boost::shared_ptr< const WGEPostprocessor > ConstSPtr
Convenience typedef for an osg::ref_ptr< const WGEPostprocessor >.
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.
virtual SPtr create(osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const =0
Create instance.
Interface class for the concept "Prototype".
PostprocessorInput()
Constructor creates empty GBuffer.
The base class for all custom post-processors.
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.
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.
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.