27 #include "../shaders/WGEPropertyUniform.h"
29 #include "WGEPostprocessorCelShading.h"
33 "This postprocessor reduces color by binning colors." )
40 "This postprocessor reduces color by binning colors." )
43 WPropInt bins =
m_properties->addProperty(
"Number of Bins",
"The number of color bins used for cel shading.", 10 );
54 s->setDefine(
"WGE_POSTPROCESSOR_CEL" );
60 osg::ref_ptr< WGEOffscreenTexturePass > pass = offscreen->addTextureProcessingPass( s,
"Cel Shading" );
64 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER0, GL_RGBA ) );
virtual WGEPostprocessor::SPtr create(osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const
Create instance.
virtual ~WGEPostprocessorCelShading()
Destructor.
WGEPostprocessorCelShading()
Default constructor.
This class encapsulates a G-Buffer.
size_t bind(osg::ref_ptr< WGEOffscreenRenderPass > to) const
Attaches these textures to the specified renderpass.
The base class for all custom post-processors.
WGEShaderPreprocessor::SPtr m_effectOnlyPreprocessor
For convenience, this is a shader preprocessor controlled by m_effectOnly property.
WPropGroup m_properties
All the properties of the post-processor.
WPropBool m_effectOnly
A flag denoting whether the effect should be combined with color or not.
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.
Class encapsulating the OSG Program class for a more convenient way of adding and modifying shader.
osg::ref_ptr< WGEShader > RefPtr
Convenience typedef for an osg::ref_ptr.