25 #ifndef WGEPOSTPROCESSOR_H
26 #define WGEPOSTPROCESSOR_H
34 #include <osg/Texture>
35 #include <osg/ref_ptr>
37 #include "../../common/WProperties.h"
38 #include "../../common/WPrototyped.h"
39 #include "../WGECamera.h"
40 #include "../offscreen/WGEOffscreenFinalPass.h"
41 #include "../offscreen/WGEOffscreenRenderNode.h"
42 #include "../offscreen/WGEOffscreenRenderPass.h"
43 #include "../shaders/WGEShaderPropertyDefineOptions.h"
75 osg::ref_ptr< osg::Texture2D > normal,
76 osg::ref_ptr< osg::Texture2D > parameter,
77 osg::ref_ptr< osg::Texture2D > tangent,
78 osg::ref_ptr< osg::Texture2D > depth );
101 size_t bind( osg::ref_ptr< WGEOffscreenRenderPass > to )
const;
132 typedef std::shared_ptr< WGEPostprocessor >
SPtr;
137 typedef std::shared_ptr< const WGEPostprocessor >
ConstSPtr;
202 virtual osg::ref_ptr< osg::Texture2D >
getOutput(
size_t idx = 0 )
const;
209 const std::vector< osg::ref_ptr< osg::Texture2D > >&
getOutputList()
const;
216 virtual osg::ref_ptr< osg::Texture2D >
getDepth()
const;
223 virtual const std::string
getName()
const;
This class encapsulates a G-Buffer.
osg::ref_ptr< osg::Texture2D > m_parameterTexture
Some not yet defined parameter texture, LUMINANCE only.
osg::ref_ptr< osg::Texture2D > m_normalTexture
Normal in RGB.
PostprocessorInput()
Constructor creates empty GBuffer.
osg::ref_ptr< osg::Texture2D > m_colorTexture
Color in RGBA.
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_tangentTexture
Tangent in RGB.
osg::ref_ptr< osg::Texture2D > m_depthTexture
Depth.
size_t bind(osg::ref_ptr< WGEOffscreenRenderPass > to) const
Attaches these textures to the specified renderpass.
The base class for all custom post-processors.
static ProcessorList m_postProcessors
List of all postprocessors.
std::string m_name
Name string.
virtual const std::string getDescription() const
Gets the description for this postprocessor.
WGEShaderPreprocessor::SPtr m_effectOnlyPreprocessor
For convenience, this is a shader preprocessor controlled by m_effectOnly property.
virtual osg::ref_ptr< osg::Texture2D > getOutput(size_t idx=0) const
Returns the result texture.
std::shared_ptr< const WGEPostprocessor > ConstSPtr
Convenience typedef for an osg::ref_ptr< const WGEPostprocessor >.
WPropGroup m_properties
All the properties of the post-processor.
static void initPostprocessors()
Needs to be called prior to any "getPostprocessors" call.
const std::vector< osg::ref_ptr< osg::Texture2D > > & getOutputList() const
This processor can produce multiple outputs.
virtual ~WGEPostprocessor()
Destructor.
WPropDouble m_effectScale
Scale the effect prior to blending it.
WPropBool m_effectOnly
A flag denoting whether the effect should be combined with color or not.
static size_t addPostprocessor(SPtr processor)
Allows adding a postprocessor.
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.
std::string m_description
Description string.
std::shared_ptr< WGEPostprocessor > SPtr
Convenience typedef for an osg::ref_ptr< WGEPostprocessor >.
std::vector< osg::ref_ptr< osg::Texture2D > > m_resultTextures
The textures contain the result.
virtual osg::ref_ptr< osg::Texture2D > getDepth() const
Returns the new depth texture.
virtual bool getFixedViewportSize() const
When this returns true, the viewport size is fixed to the size of the target texture.
virtual SPtr create(osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const =0
Create instance.
WGEPostprocessor(std::string name, std::string description)
Create named prototype.
osg::ref_ptr< osg::Texture2D > m_depthTexture
The texture contains the new depth.
virtual const std::string getName() const
Gets the name of this postprocessor.
std::vector< WGEPostprocessor::SPtr > ProcessorList
Type used for returning lists of postprocessor prototypes.
std::shared_ptr< WGEShaderPreprocessor > SPtr
Shared pointer for this class.
Interface class for the concept "Prototype".