version 3.3

VRS::MirrorTechniqueGL Class Reference

#include <vrs/opengl/mirrortechniquegl.h>

Inheritance diagram for VRS::MirrorTechniqueGL:

VRS::TechniqueGL VRS::Technique VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 MirrorTechniqueGL ()
virtual void start (Engine *)
virtual void stop (Engine *)
virtual bool preparePass (Engine *)
virtual void finishPass (Engine *)
virtual void nextPass (Engine *)
virtual bool usesPass (int pass) const
virtual bool prepareEval (Engine *engine, const Shape *shape)
virtual void finishEval (Engine *engine, const Shape *shape)
virtual bool canBeUsed (Engine *engine) const
 VRS_TYPEINFO (MirrorTechniqueGL, TechniqueGL)
 VRS_SERIALIZABLE (MirrorTechniqueGL)

Static Public Member Functions

static bool haveMirroredReferencingMirror (const Mirror *, Engine *, Engine::SwitchType)
 Helper method, also used by CubeEnvMirrorTechniqueGL.
static ShapeMaterialGLnewMaterialWithAlphaAsQuality (const Mirror *, Engine *engine)
 Helper method, also used by CubeEnvMirrorTechniqueGL.


Constructor & Destructor Documentation

VRS::MirrorTechniqueGL::MirrorTechniqueGL (  ) 

Technique which is responsable for rendering planar reflectors. For rendering such a reflector, you need a PlanarMirror attribute and a suitable Mirrored attribute.
The MirrortechniqueGL works as follows: in the first pass, the scene is rendered as usual, mirroring facets are ommited. Those facets are rendered black in the second pass, each of them is tagged with an unique stencilbit. In the third pass MIRROR, the shape objects mirrored from a mirroring facet are rendered from the mirrored camera position. The last pass MIRRORFACETREDRAW is used to blend the surface of the mirrorfacet together with the mirrored scene. The better the quality of the mirror is, the lesser is the brightness of the facet and the higher the brightness of the mirrored scene.
The ideas for this technique was taken from http://reality.sgi.com/opengl/tips/Reflect.html


Member Function Documentation

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

Starts a technique. For all techniques in the scene graph, this method is called at the end of the pretraversal. The default behaviour is to add all passes in the pass array to the current TechniqueProcessor. If this is expected, subclasses should call "Technique::class()".

Reimplemented from VRS::Technique.

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

Stops a technique. For all techniques in the scene graph, this method is called in the method "stop()" of the TechniqueProcessor.

Reimplemented from VRS::Technique.

virtual bool VRS::MirrorTechniqueGL::preparePass ( Engine  )  [virtual]

For an active technique, this method is invoked before the traversal of the scene graph in a rendering pass. Settings of the low-level rendering system valid for the whole rendering pass should be made here. "preparePass()" can return false, which indicates that the technique does not need to evaluate the scene graph. However, if at least one of the active techniques returns true, the scene graph is evaluated.

Implements VRS::Technique.

virtual void VRS::MirrorTechniqueGL::finishPass ( Engine  )  [virtual]

For an active technique, this method is invoked after the traversal of the scene graph. The changes made in "preparePass()" should be undone here

Implements VRS::Technique.

virtual void VRS::MirrorTechniqueGL::nextPass ( Engine  )  [virtual]

For an active technique, this method is also invoked after the traversal of the scene graph. If a technique decides that it needs to redo a rendering pass, it can tell the TechniqueProcessor here, using "addPass()"

Reimplemented from VRS::Technique.

virtual bool VRS::MirrorTechniqueGL::usesPass ( int  pass  )  const [virtual]

as convention, all passes between MIRRORPASSESBEGIN and MIRRORPASSESEND are evaluated also mirrored. Other Techniques can profit from this feature through implementing additional passes besides MIRROR. The effects implemented by these techniques then can be visible also for the mirroring shapes.

Reimplemented from VRS::Technique.

virtual bool VRS::MirrorTechniqueGL::prepareEval ( Engine engine,
const Shape shape 
) [virtual]

For an active Technique, this method is invoked before the evaluation of a shape. Settings of the low-level rendering system only needed for certain shapes (usually indicated by special attributes) should be applied here. "prepareEval()" can forbid the evaluation of a shape by returning false. In this case, even when all other active techniques return true, the shape is not evaluated.

Implements VRS::Technique.

virtual void VRS::MirrorTechniqueGL::finishEval ( Engine engine,
const Shape shape 
) [virtual]

For an active Technique, this method is invoked after the evaluation of a shape (also when shape evaluation was forbidden in "prepareEval()"). Changes made in "prepareEval()" should be undone here.

Implements VRS::Technique.

virtual bool VRS::MirrorTechniqueGL::canBeUsed ( Engine engine  )  const [virtual]

This technique needs a stencil buffer.

Reimplemented from VRS::Technique.

VRS::MirrorTechniqueGL::VRS_TYPEINFO ( MirrorTechniqueGL  ,
TechniqueGL   
)

VRS::MirrorTechniqueGL::VRS_SERIALIZABLE ( MirrorTechniqueGL   ) 

static bool VRS::MirrorTechniqueGL::haveMirroredReferencingMirror ( const Mirror ,
Engine ,
Engine::SwitchType   
) [static]

Helper method, also used by CubeEnvMirrorTechniqueGL.

static ShapeMaterialGL* VRS::MirrorTechniqueGL::newMaterialWithAlphaAsQuality ( const Mirror ,
Engine engine 
) [static]

Helper method, also used by CubeEnvMirrorTechniqueGL.

Helper methods that are needed by Techniques to render mirrors. They should be probably factored out into a helper class, and are normally not to be called from applications.


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

Generated on Tue May 21 06:00:26 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact