27 #include "../shaders/WGEPropertyUniform.h"
28 #include "../shaders/WGEShaderPropertyDefineOptions.h"
30 #include "WGEPostprocessorEdgeEnhance.h"
34 "Edge detection filter to emphasize edges in complex geometry." )
41 "Edge detection filter to emphasize edges in complex geometry." )
44 WPropBool whiteEdge =
m_properties->addProperty(
"White Edge",
"If set, the edge is drawn in white instead of black.",
false );
45 WPropDouble edgeThresholdL =
m_properties->addProperty(
"Edge Lower Threshold",
"Define the edge threshold. Filters way \"weak\" edges.", 0.0 );
46 WPropDouble edgeThresholdU =
m_properties->addProperty(
"Edge Upper Threshold",
"Define the edge threshold. Filters way \"weak\" edges.", 1.0 );
47 edgeThresholdL->setMin( 0.0 );
48 edgeThresholdL->setMax( 1.0 );
49 edgeThresholdU->setMin( 0.0 );
50 edgeThresholdU->setMax( 1.0 );
54 s->setDefine(
"WGE_POSTPROCESSOR_EDGE" );
63 osg::ref_ptr< WGEOffscreenTexturePass > pass = offscreen->addTextureProcessingPass( s,
"Edge Detection" );
68 m_resultTextures.push_back( pass->attach( WGECamera::COLOR_BUFFER0, GL_RGB ) );
WGEPostprocessorEdgeEnhance()
Default constructor.
virtual ~WGEPostprocessorEdgeEnhance()
Destructor.
virtual WGEPostprocessor::SPtr create(osg::ref_ptr< WGEOffscreenRenderNode > offscreen, const PostprocessorInput &gbuffer) const
Create instance.
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.
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.
std::shared_ptr< WGEShaderPreprocessor > SPtr
Shared pointer for this class.
This is a WGEShaderDefineOptions class which additionally uses a property to automatically control th...
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.