VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
makVrv::DtPostProcessor Class Referenceabstract

This class provides the OSG-specific implementation of a post processor. A post processor has a type (ex. "wateronscreen") and a list of effects which are components that can be turned on or off (ex. "oceanspray", "rainsplash"). A post processor should register at least one effect. The post processor order is created in the DtPostProcessorFactory On channel creation, the DtPostProcessManagerInterface will create an instance of each post processor added to the factory's post processor list.

Inheritance diagram for makVrv::DtPostProcessor:
Inheritance graph
[legend]

Public Member Functions

 DtPostProcessor (DtDe &de, const std::string &postProcessType, bool handles2D)
 
virtual ~DtPostProcessor ()
 
virtual void setFragmentShaderSource (const char *source)
 
virtual void setVertexShaderSource (const char *source)
 
virtual void setFragmentShaderFile (const std::string &fileName)
 
virtual void setVertexShaderFile (const std::string &fileName)
 
virtual void setInputTexture (const DtChannel *channel, osg::Texture *texture)
 
virtual bool update (DtChannel *channel)=0
 
virtual osg::Texture * outputTexture ()
 
virtual void setIsFinalEffect (const DtChannel *channel, bool final)
 
virtual osg::Camera * cameraForChannel (const DtChannel *channel)
 
virtual void slot_releaseResources ()
 
virtual void releaseGLObjects ()
 
virtual bool hasEffect (const std::string &effect)
 
virtual bool effectEnabled (const std::string &effect)
 
virtual bool anyEffectEnabled ()
 
virtual std::list< std::string > supportedEffects ()
 
virtual bool handles2D () const
 
virtual const std::string & type () const
 
virtual bool postProcessorEnabled ()
 
virtual bool needsOcclusionTexture () const
 
virtual bool enableEffect (const std::string &effect)
 
virtual bool disableEffect (const std::string &effect)
 
virtual void enablePostProcessor ()
 
virtual void disablePostProcessor ()
 

Protected Types

typedef boost::unordered_map
< std::string, bool
EffectMap
 
typedef std::map< const
DtChannel *, osg::ref_ptr
< osg::Camera > > 
CameraMap
 
typedef osg::ref_ptr
< DtPostProcessorCullVistorCallback
CallbackRefPtr
 
typedef std::map< const
DtChannel *, CallbackRefPtr
CallbackMap
 

Protected Member Functions

virtual bool effectItrEnabled (const EffectMap::iterator &effect) const
 
virtual void initialize ()
 
virtual void addEffect (std::string effect)
 
virtual void setEnablePostProcessor (bool enabled)
 

Protected Attributes

osg::ref_ptr< osg::Texture > myOutputTexture
 
osg::ref_ptr< osg::Texture > myInputTexture
 
osg::ref_ptr< osg::Program > myProgram
 
osg::ref_ptr< osg::Shader > myFragmentShader
 
osg::ref_ptr< osg::Shader > myVertexShader
 
osg::ref_ptr< osg::Geode > myQuad
 
CameraMap myCameraMap
 
bool myHandles2DFlag
 
bool myEnabledFlag
 
std::string myType
 
EffectMap myEffects
 
CallbackMap myCullCallbackMap
 
DtDemyDe
 
DtSignalConnectionManager mySignals
 

Friends

class DtPostProcessManager
 

Member Typedef Documentation

typedef boost::unordered_map<std::string, bool> makVrv::DtPostProcessor::EffectMap
protected
typedef std::map<const DtChannel*, osg::ref_ptr<osg::Camera> > makVrv::DtPostProcessor::CameraMap
protected
typedef std::map< const DtChannel*, CallbackRefPtr > makVrv::DtPostProcessor::CallbackMap
protected

Constructor & Destructor Documentation

makVrv::DtPostProcessor::DtPostProcessor ( DtDe de,
const std::string &  postProcessType,
bool  handles2D 
)

CTOR.

Parameters
handles2DWhether this post processor should be used in 2D orthographic views.
virtual makVrv::DtPostProcessor::~DtPostProcessor ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtPostProcessor::setFragmentShaderSource ( const char source)
virtual

Sets fragment shader source for this post-processor. The following uniforms will be automatically set for you: sampler2D inputImage; float aspectRatio; // (width over height) float fovy; // Vertical field of view (radians)

virtual void makVrv::DtPostProcessor::setVertexShaderSource ( const char source)
virtual

Sets vertex shader source for this post-processor. The following uniforms will be automatically set for you: sampler2D inputImage; float aspectRatio; // (width over height) float fovy; // Vertical field of view (radians)

virtual void makVrv::DtPostProcessor::setFragmentShaderFile ( const std::string &  fileName)
virtual

Sets fragment shader file for this post-processor. The following uniforms will be automatically set for you: sampler2D inputImage; float aspectRatio; // (width over height) float fovy; // Vertical field of view (radians)

virtual void makVrv::DtPostProcessor::setVertexShaderFile ( const std::string &  fileName)
virtual

Sets vertex shader file for this post-processor. The following uniforms will be automatically set for you: sampler2D inputImage; float aspectRatio; // (width over height) float fovy; // Vertical field of view (radians)

virtual void makVrv::DtPostProcessor::setInputTexture ( const DtChannel channel,
osg::Texture *  texture 
)
virtual

Sets the image that is postprocessed; this may be the 3D scene rendered to a texture, or the output texture of a chained post processor. Managed by the DtPostProcessManager, you shouldn't need to call this yourself.

Reimplemented in makVrv::DtSenSimPostProcessor, makVrv::DtHdrPostProcessor, makVrv::DtVolumetricLighting, makVrv::DtHbaoPostProcessor, and makVrv::DtVideoStreamPostProcessor.

virtual bool makVrv::DtPostProcessor::update ( DtChannel channel)
pure virtual
virtual osg::Texture* makVrv::DtPostProcessor::outputTexture ( )
virtual

Gets the output texture of this post processor, for use in chaining processors together. It may be null if this is the last post processor, rendering directly to the frame buffer.

Reimplemented in makVrv::DtVolumetricLighting.

virtual void makVrv::DtPostProcessor::setIsFinalEffect ( const DtChannel channel,
bool  final 
)
virtual

Called by the DtPostProcessManager to indicate if this is the last post processor in the chain, and should render to the framebuffer.

Reimplemented in makVrv::DtSenSimPostProcessor.

virtual osg::Camera* makVrv::DtPostProcessor::cameraForChannel ( const DtChannel channel)
virtual

Gets the Camera node associated with this effect and channel. Use their statesets to set shader uniforms for your effect.

virtual void makVrv::DtPostProcessor::slot_releaseResources ( )
virtual

used to call releaseGLObjects on this post processor's openGL related objects when the last window is removed.

virtual void makVrv::DtPostProcessor::releaseGLObjects ( )
virtual

cleanup any graphics related stuff when the last window is removed since the graphics context will soon be destroyed.

Reimplemented in makVrv::DtWaterOnScreen, and makVrv::DtHdrPostProcessor.

virtual bool makVrv::DtPostProcessor::hasEffect ( const std::string &  effect)
virtual

Does this post processor support this effect?

virtual bool makVrv::DtPostProcessor::effectEnabled ( const std::string &  effect)
virtual

Is this effect (post processor sub-component) enabled?

virtual bool makVrv::DtPostProcessor::anyEffectEnabled ( )
virtual

Are any effects enabled?

virtual bool makVrv::DtPostProcessor::enableEffect ( const std::string &  effect)
virtual

Enable a particular post processing technique For example, "wateroncamera" has techniques "rainsplash", "oceanspray", and "wavesplash".

virtual bool makVrv::DtPostProcessor::disableEffect ( const std::string &  effect)
virtual

Enable a particular post processing technique For example, "wateroncamera" has techniques "rainsplash", "oceanspray", and "wavesplash".

virtual std::list<std::string> makVrv::DtPostProcessor::supportedEffects ( )
virtual

Get a list of supported effects for this post processor.

virtual bool makVrv::DtPostProcessor::handles2D ( ) const
virtual

Retrieves whether this post processor should be used in 2D orthographic views, as specified in its constructor.

virtual const std::string& makVrv::DtPostProcessor::type ( ) const
virtual

Gets the type of the post processor.

virtual void makVrv::DtPostProcessor::enablePostProcessor ( )
virtual

Enable or disable the post processor.

virtual void makVrv::DtPostProcessor::disablePostProcessor ( )
virtual

Enable or disable the post processor.

virtual bool makVrv::DtPostProcessor::postProcessorEnabled ( )
virtual

Is this post processor enabled?

Reimplemented in makVrv::DtHdrPostProcessor, makVrv::DtVolumetricLighting, and makVrv::DtPlanViewPostProcessor.

virtual bool makVrv::DtPostProcessor::needsOcclusionTexture ( ) const
virtual

Does this post processor need an occlusion texture generated by the osgChannel false by default but derrived classes can override this and let the manager know they need an occlusion texture.

Reimplemented in makVrv::DtVolumetricLighting, and makVrv::DtHbaoPostProcessor.

virtual bool makVrv::DtPostProcessor::effectItrEnabled ( const EffectMap::iterator &  effect) const
protectedvirtual

Reimplemented in makVrv::DtHdrPostProcessor.

virtual void makVrv::DtPostProcessor::initialize ( )
protectedvirtual

Reimplemented in makVrv::DtWaterOnScreen.

virtual void makVrv::DtPostProcessor::addEffect ( std::string  effect)
protectedvirtual

When constructing a post processor, add the names of the sub-components (effects) that can be enabled and disabled.

virtual void makVrv::DtPostProcessor::setEnablePostProcessor ( bool  enabled)
protectedvirtual

Set the post processor enabled state (true = enabled)

Friends And Related Function Documentation

friend class DtPostProcessManager
friend

Member Data Documentation

osg::ref_ptr<osg::Texture> makVrv::DtPostProcessor::myOutputTexture
protected
osg::ref_ptr<osg::Texture> makVrv::DtPostProcessor::myInputTexture
protected
osg::ref_ptr<osg::Program> makVrv::DtPostProcessor::myProgram
protected
osg::ref_ptr<osg::Shader> makVrv::DtPostProcessor::myFragmentShader
protected
osg::ref_ptr<osg::Shader> makVrv::DtPostProcessor::myVertexShader
protected
osg::ref_ptr<osg::Geode> makVrv::DtPostProcessor::myQuad
protected
CameraMap makVrv::DtPostProcessor::myCameraMap
protected
bool makVrv::DtPostProcessor::myHandles2DFlag
protected
bool makVrv::DtPostProcessor::myEnabledFlag
protected
std::string makVrv::DtPostProcessor::myType
protected
EffectMap makVrv::DtPostProcessor::myEffects
protected
CallbackMap makVrv::DtPostProcessor::myCullCallbackMap
protected
DtDe& makVrv::DtPostProcessor::myDe
protected
DtSignalConnectionManager makVrv::DtPostProcessor::mySignals
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)