version 3.3

VRS::TransparencyTechniqueGL Class Reference

TransparencyTechniqueGL for rendering transparent shapes. More...

#include <vrs/opengl/transparencytechniquegl.h>

Inheritance diagram for VRS::TransparencyTechniqueGL:

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

List of all members.

Public Member Functions

 TransparencyTechniqueGL (bool considerAlphaTextures=false)
virtual void start (Engine *)
virtual bool preparePass (Engine *)
virtual void finishPass (Engine *)
virtual bool prepareEval (Engine *engine, const Shape *shape)
virtual void finishEval (Engine *engine, const Shape *shape)
void setConsiderAlphaTextures (bool on)
bool considerAlphaTextures () const
void setBlendAttribute (SO< ColorBufferGL > val)
 VRS_TYPEINFO (TransparencyTechniqueGL, TechniqueGL)
 VRS_SERIALIZABLE (TransparencyTechniqueGL)


Detailed Description

TransparencyTechniqueGL for rendering transparent shapes.

This technique first renders all opaque shapes and in a second rendering pass the transparent ones. This ensures that transparent pixels are drawn over the opaque ones with a higher z-value.

If a shape is transparent is defined by either a ShapeMaterialGL or ImageTexture{1,2,3}DGL attribute. A ShapeMaterialGL is transparent if its method isTransparent() returns true. An ImageTexture1DGL, ImageTexture2DGL or ImageTexture3DGL is seen as transparent if it contains an alpha layer (by inspecting the actual OpenGL internal texture format, not the VRS Image that forms the basis for the texture).

By default, only ShapeMaterialGLs are considered. To check for ImageTexture{1,2,3}GL containing alpha channels, you have to set the according parameter in the constructor.


Constructor & Destructor Documentation

VRS::TransparencyTechniqueGL::TransparencyTechniqueGL ( bool  considerAlphaTextures = false  ) 

The default constructor creates a TransparencyTechniqueGL that only looks for transparent ShapeMaterialGLs. For more options see the parameters.

Parameters:
considerAlphaTextures Consider shapes attributed with an ImageTexture1DGL, ImageTexture2DGL or ImageTexture3DGL that have an alpha channel as transparent.


Member Function Documentation

virtual void VRS::TransparencyTechniqueGL::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 bool VRS::TransparencyTechniqueGL::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::TransparencyTechniqueGL::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 bool VRS::TransparencyTechniqueGL::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::TransparencyTechniqueGL::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.

void VRS::TransparencyTechniqueGL::setConsiderAlphaTextures ( bool  on  ) 

bool VRS::TransparencyTechniqueGL::considerAlphaTextures (  )  const

void VRS::TransparencyTechniqueGL::setBlendAttribute ( SO< ColorBufferGL val  )  [inline]

VRS::TransparencyTechniqueGL::VRS_TYPEINFO ( TransparencyTechniqueGL  ,
TechniqueGL   
)

VRS::TransparencyTechniqueGL::VRS_SERIALIZABLE ( TransparencyTechniqueGL   ) 


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

Generated on Wed May 22 06:00:28 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact