29 #include "WGEGeodeUtils.h"
30 #include "shaders/WGEShader.h"
31 #include "callbacks/WGENodeMaskCallback.h"
33 #include "WGEViewerEffect.h"
39 setClearMask( GL_DEPTH_BUFFER_BIT );
40 setRenderOrder( WGECamera::POST_RENDER );
41 setReferenceFrame( osg::Transform::ABSOLUTE_RF );
42 setProjectionMatrixAsOrtho2D( 0.0, 1.0, 0.0, 1.0 );
43 setViewMatrix( osg::Matrixd::identity() );
46 m_state = getOrCreateStateSet();
47 m_state->setMode( GL_DEPTH_TEST, osg::StateAttribute::PROTECTED |
48 osg::StateAttribute::OVERRIDE |
49 osg::StateAttribute::OFF );
50 m_state->setMode( GL_LIGHTING, osg::StateAttribute::PROTECTED |
51 osg::StateAttribute::OVERRIDE |
52 osg::StateAttribute::OFF );
53 m_state->setMode( GL_BLEND, osg::StateAttribute::PROTECTED |
54 osg::StateAttribute::OVERRIDE |
55 osg::StateAttribute::ON );
57 osg::Depth* depth =
new osg::Depth;
58 depth->setWriteMask(
false );
59 m_state->setAttributeAndModes( depth, osg::StateAttribute::PROTECTED |
60 osg::StateAttribute::OVERRIDE |
61 osg::StateAttribute::ON );
64 osg::Vec3( 1.0, 0.0, 0.0 ),
65 osg::Vec3( 0.0, 1.0, 0.0 ) );
66 m_geode->setName(
"__Viewer Effect Plane" );
94 m_active->setRecommendedValue( enableByDefault );
This callback is useful to en-/disable nodes using the node mask based on properties.
WGEViewerEffect(std::string name, std::string description, const char **icon=NULL)
Create the effect.
WPropBool m_active
Enable or disable effect.
virtual void setEnabled(bool enable=true)
Set the effect enabled.
virtual bool isEnabled() const
Check whether the effect is active or not.
virtual void setEnabledByDefault(bool enableByDefault=true)
Use this to activate an effect by default.
osg::ref_ptr< osg::StateSet > m_state
The stateset of the cam.
osg::ref_ptr< osg::Geode > m_geode
The fullscreen quad.
virtual ~WGEViewerEffect()
Destructor.
This is a base class for everything which has a Name,Description,Icon and Properties (=NDIP).
WProperties::SPtr m_properties
the properties of the object.
osg::ref_ptr< osg::Geode > genFinitePlane(double xSize, double ySize, const WPlane &p, const WColor &color=WColor(0.0, 0.7, 0.7, 1.0), bool border=false)
Generates a geode out of a Plane with a fixed size in direction of the vectors which span that plane.