version 3.3

EnvironmentRenderer::SkyTechnique Class Reference

The SkyTechnique creates an aerial-perspecive-effect for a 3D scene. More...

#include <vrs/environment/skytechnique.h>

Inheritance diagram for EnvironmentRenderer::SkyTechnique:

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

List of all members.

Public Member Functions

 SkyTechnique (SkyDome *sky, bool aerialPerspectiveEnabled=false, bool aerialPerspectivePerFragment=true)
 the SkyTechnique can be used to easily manage a sky and perform aerial perspective calculations (objects' colors fade to a paler, bluish color in the distance) depending on the sky's parameters.
void setSky (SkyDome *sky)
 change/get the sky, which is used for rendering
SkyDomegetSky () const
void enableAerialPerspective (bool yesNo)
 enable/disable aerial perspective
bool isAerialPerspectiveEnabled () const
void setAerialPerspectivePerFragment (bool yesNo)
 enable/disable aerial perspective per-fragment
bool getAerialPerspectivePerFragment () const
virtual bool preparePass (VRS::Engine *)
virtual void finishPass (VRS::Engine *)
virtual bool prepareEval (VRS::Engine *, const VRS::Shape *)
virtual void finishEval (VRS::Engine *, const VRS::Shape *)
virtual bool canBeUsed (VRS::Engine *engine) const
 checks for the following extensions
  • GL_ARB_shader_objects
  • GL_ARB_vertex_shader
  • GL_ARB_fragment_shader

 VRS_TYPEINFO (SkyTechnique, VRS::TechniqueGL)
 VRS_SERIALIZABLE (SkyTechnique)


Detailed Description

The SkyTechnique creates an aerial-perspecive-effect for a 3D scene.

It works at the same rendering-pass as BackgrounGL, so results are undefined when there is a background in the scene.


Constructor & Destructor Documentation

EnvironmentRenderer::SkyTechnique::SkyTechnique ( SkyDome sky,
bool  aerialPerspectiveEnabled = false,
bool  aerialPerspectivePerFragment = true 
)

the SkyTechnique can be used to easily manage a sky and perform aerial perspective calculations (objects' colors fade to a paler, bluish color in the distance) depending on the sky's parameters.

  • sky: the provided skydome must not be NULL as all atmospheric parameters are taken from it. the sky must be part of the scenegraph
  • enableAerialPerspective: if true, objects' colors are pushed towards a pale blue tint with increasing distance to the camera
  • aerialPerspectivePerFragment: only considered, if aerial perspective is enabled. if enabled, the scattering-calculations are performed per fragment, not per vertex. this will increase the visual quality of the effect, but also will reduce rendering-speed


Member Function Documentation

void EnvironmentRenderer::SkyTechnique::setSky ( SkyDome sky  ) 

change/get the sky, which is used for rendering

SkyDome* EnvironmentRenderer::SkyTechnique::getSky (  )  const

void EnvironmentRenderer::SkyTechnique::enableAerialPerspective ( bool  yesNo  ) 

enable/disable aerial perspective

bool EnvironmentRenderer::SkyTechnique::isAerialPerspectiveEnabled (  )  const

void EnvironmentRenderer::SkyTechnique::setAerialPerspectivePerFragment ( bool  yesNo  ) 

enable/disable aerial perspective per-fragment

bool EnvironmentRenderer::SkyTechnique::getAerialPerspectivePerFragment (  )  const

virtual bool EnvironmentRenderer::SkyTechnique::preparePass ( VRS::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 EnvironmentRenderer::SkyTechnique::finishPass ( VRS::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 EnvironmentRenderer::SkyTechnique::prepareEval ( VRS::Engine engine,
const VRS::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 EnvironmentRenderer::SkyTechnique::finishEval ( VRS::Engine engine,
const VRS::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 EnvironmentRenderer::SkyTechnique::canBeUsed ( VRS::Engine engine  )  const [virtual]

checks for the following extensions

  • GL_ARB_shader_objects
  • GL_ARB_vertex_shader
  • GL_ARB_fragment_shader

Reimplemented from VRS::Technique.

EnvironmentRenderer::SkyTechnique::VRS_TYPEINFO ( SkyTechnique  ,
VRS::TechniqueGL   
)

EnvironmentRenderer::SkyTechnique::VRS_SERIALIZABLE ( SkyTechnique   ) 


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

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