version 3.3

VRS::DepthOfFieldRendererGL Class Reference

#include <vrs/opengl/depthoffieldrenderergl.h>

Inheritance diagram for VRS::DepthOfFieldRendererGL:

VRS::MultiSceneRenderer VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 DepthOfFieldRendererGL (Camera *camera, unsigned int samples=4, double sizeX=1.0, double sizeY=1.0, double focus=1.0)
 MultiSceneRenderer for rendering a depth-of-field effect using the accumulation buffer.
void setCamera (Camera *camera)
 Sets the camera for rendering the depth-of-field effect.
CameragetCamera () const
 Gets the camera.
void setNumberOfSamples (unsigned int samples)
 Sets the number of samples for rendering the depth-of-field effect.
unsigned int getNumberOfSamples () const
 Gets the number of samples.
void setSizeX (double sizeX)
 Sets the extend of the depth-of-field effect in x-direction.
double getSizeX () const
 Gets the extend of the depth-of-field effect in x-direction.
void setSizeY (double sizeY)
 Sets the extend of the depth-of-field effect in y-direction.
double getSizeY () const
 Gets the extend of the depth-of-field effect in y-direction.
void setFocus (double focus)
 Sets the focus in Normalized Device Coordinates (before projection, near is >0.0, far is 1.0).
double getFocus () const
 Gets the focus.
virtual void start (Engine *)
 Starts depth-of-field rendering. The number of required scene graph evaluations is samples.
virtual void stop (Engine *)
 Stops depth-of-field rendering, copying accumulated stuff into frame buffer.
virtual bool needSceneEvaluation (Engine *)
 The number of required scene graph evaluations is samples.
virtual void preEvaluateScene (Engine *)
 jitters the camera position, using a shearing to have a z-plane in focus
virtual void postEvaluateScene (Engine *)
 Uses the accumulation buffer to accumulating results.
 VRS_TYPEINFO (DepthOfFieldRendererGL, MultiSceneRenderer)
 VRS_SERIALIZABLE (DepthOfFieldRendererGL)

Protected Member Functions

 DepthOfFieldRendererGL ()


Constructor & Destructor Documentation

VRS::DepthOfFieldRendererGL::DepthOfFieldRendererGL ( Camera camera,
unsigned int  samples = 4,
double  sizeX = 1.0,
double  sizeY = 1.0,
double  focus = 1.0 
)

MultiSceneRenderer for rendering a depth-of-field effect using the accumulation buffer.

For depth-of-field rendering, plug an instance of this class to a canvas using the method setSceneRenderer() of the canvas. In case no accumulation buffer is available, no depth-of-field effect will be rendered. The camera must be non-zero.

VRS::DepthOfFieldRendererGL::DepthOfFieldRendererGL (  )  [protected]


Member Function Documentation

void VRS::DepthOfFieldRendererGL::setCamera ( Camera camera  ) 

Sets the camera for rendering the depth-of-field effect.

The camera must be the scene camera in the scene graph.

Camera* VRS::DepthOfFieldRendererGL::getCamera (  )  const

Gets the camera.

void VRS::DepthOfFieldRendererGL::setNumberOfSamples ( unsigned int  samples  ) 

Sets the number of samples for rendering the depth-of-field effect.

Each sample corresponds to a scene graph evaluation with a jittered camera position. samples must be greater or equal than 1 (if samples is 1, actually no depth-of-field rendering will occur, obviously.) Currently jittering values for 1, 2, 3, 4, 5, 6, 8, 9, 12, 15, 24, and 66 samples are provided. If samples it set to a different value, the first jitter values of the next bigger jittering table will be used (or at max. 66 samples). The jittering values then are probably not uniformly distributed, but this is likely not noticable.

unsigned int VRS::DepthOfFieldRendererGL::getNumberOfSamples (  )  const

Gets the number of samples.

void VRS::DepthOfFieldRendererGL::setSizeX ( double  sizeX  ) 

Sets the extend of the depth-of-field effect in x-direction.

x-jitter values are multiplied with sizeX.

double VRS::DepthOfFieldRendererGL::getSizeX (  )  const

Gets the extend of the depth-of-field effect in x-direction.

void VRS::DepthOfFieldRendererGL::setSizeY ( double  sizeY  ) 

Sets the extend of the depth-of-field effect in y-direction.

y-jitter values are multiplied with sizeY.

double VRS::DepthOfFieldRendererGL::getSizeY (  )  const

Gets the extend of the depth-of-field effect in y-direction.

void VRS::DepthOfFieldRendererGL::setFocus ( double  focus  ) 

Sets the focus in Normalized Device Coordinates (before projection, near is >0.0, far is 1.0).

The focus must not be necessarily be inside (0.0, 1.0], but if it is outside, no z-plane in the frustum will be really in focus and sharp.

double VRS::DepthOfFieldRendererGL::getFocus (  )  const

Gets the focus.

virtual void VRS::DepthOfFieldRendererGL::start ( Engine  )  [virtual]

Starts depth-of-field rendering. The number of required scene graph evaluations is samples.

Implements VRS::MultiSceneRenderer.

virtual void VRS::DepthOfFieldRendererGL::stop ( Engine  )  [virtual]

Stops depth-of-field rendering, copying accumulated stuff into frame buffer.

Implements VRS::MultiSceneRenderer.

virtual bool VRS::DepthOfFieldRendererGL::needSceneEvaluation ( Engine  )  [virtual]

The number of required scene graph evaluations is samples.

Implements VRS::MultiSceneRenderer.

virtual void VRS::DepthOfFieldRendererGL::preEvaluateScene ( Engine  )  [virtual]

jitters the camera position, using a shearing to have a z-plane in focus

Implements VRS::MultiSceneRenderer.

virtual void VRS::DepthOfFieldRendererGL::postEvaluateScene ( Engine  )  [virtual]

Uses the accumulation buffer to accumulating results.

Implements VRS::MultiSceneRenderer.

VRS::DepthOfFieldRendererGL::VRS_TYPEINFO ( DepthOfFieldRendererGL  ,
MultiSceneRenderer   
)

VRS::DepthOfFieldRendererGL::VRS_SERIALIZABLE ( DepthOfFieldRendererGL   ) 


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

Generated on Mon May 21 06:00:20 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact