version 3.3

EnvironmentRenderer::WaterSurfaceTechnique Class Reference

This Technique performs the rendering passes which are necessary for rendering of WaterSurfaces. More...

#include <vrs/environment/watersurfacetechnique.h>

Inheritance diagram for EnvironmentRenderer::WaterSurfaceTechnique:

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

List of all members.

Public Member Functions

 WaterSurfaceTechnique (bool reflectAll=false, unsigned int textureWidth=512, unsigned int textureHeight=512)
 Constructs a new WaterSurfaceTechnique The 'resourcePath'-parameter denotes the location to the normal-maps used by the water surface.
void setReflectAll (bool reflectAll)
bool getReflectAll () const
void setReflFilter (VRS::TextureGL::FilterMode min=VRS::TextureGL::LINEAR, VRS::TextureGL::FilterMode mag=VRS::TextureGL::LINEAR)
void setRefrFilter (VRS::TextureGL::FilterMode min=VRS::TextureGL::LINEAR, VRS::TextureGL::FilterMode mag=VRS::TextureGL::LINEAR)
VRS::TextureGL::FilterMode reflMinFilter () const
VRS::TextureGL::FilterMode reflMagFilter () const
VRS::TextureGL::FilterMode refrMinFilter () const
VRS::TextureGL::FilterMode refrMagFilter () const
VRS::SO< VRS::Texture2DGLgetReflectionTexture (VRS::SO< WaterSurface > watersurface)
 These functions return the current reflection-/refraction-textures for the given watersurface.
VRS::SO< VRS::Texture2DGLgetRefractionTexture ()
VRS::SO< VRS::Texture2DGLgetMaskTexture ()
void registerBackgroundTechnique (VRS::SO< VRS::BackgroundGL > background)
 If a background is used, it should be also reflected in water surfaces.
void setTextureSize (unsigned int width, unsigned int height)
 The default texturesize is 512x512.
unsigned int getTextureWidth () const
unsigned int getTextureHeight () const
virtual void start (VRS::Engine *)
virtual void stop (VRS::Engine *)
virtual bool preparePass (VRS::Engine *)
virtual void finishPass (VRS::Engine *)
virtual void nextPass (VRS::Engine *)
virtual bool prepareEval (VRS::Engine *engine, const VRS::Shape *shape)
virtual void finishEval (VRS::Engine *engine, const VRS::Shape *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
  • GL_ARB_texture_non_power_of_two
  • GL_EXT_framebuffer_object

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

Classes

struct  WaterSurfaceData
 structure which stores render targets and other per-watersurface data


Detailed Description

This Technique performs the rendering passes which are necessary for rendering of WaterSurfaces.


Constructor & Destructor Documentation

EnvironmentRenderer::WaterSurfaceTechnique::WaterSurfaceTechnique ( bool  reflectAll = false,
unsigned int  textureWidth = 512,
unsigned int  textureHeight = 512 
)

Constructs a new WaterSurfaceTechnique The 'resourcePath'-parameter denotes the location to the normal-maps used by the water surface.

If it is empty, the default normal-maps are used. The reflectAll parameter is for convenience. If set to true no WaterReflected-attributes are required in the scenegraph. Everything is reflected by all water surfaces. Attributes with 'renderOnlyReflection' set to true can be used to restrict rendering of certain objects only to the reflection-texture-passes. NOTE: Setting 'reflectAll' to true may result in severe performance-losses for large scenes, as all objects are rendered several times. textureWidth and textureHeight define the used texture resolution


Member Function Documentation

void EnvironmentRenderer::WaterSurfaceTechnique::setReflectAll ( bool  reflectAll  ) 

bool EnvironmentRenderer::WaterSurfaceTechnique::getReflectAll (  )  const

void EnvironmentRenderer::WaterSurfaceTechnique::setReflFilter ( VRS::TextureGL::FilterMode  min = VRS::TextureGL::LINEAR,
VRS::TextureGL::FilterMode  mag = VRS::TextureGL::LINEAR 
)

void EnvironmentRenderer::WaterSurfaceTechnique::setRefrFilter ( VRS::TextureGL::FilterMode  min = VRS::TextureGL::LINEAR,
VRS::TextureGL::FilterMode  mag = VRS::TextureGL::LINEAR 
)

VRS::TextureGL::FilterMode EnvironmentRenderer::WaterSurfaceTechnique::reflMinFilter (  )  const [inline]

VRS::TextureGL::FilterMode EnvironmentRenderer::WaterSurfaceTechnique::reflMagFilter (  )  const [inline]

VRS::TextureGL::FilterMode EnvironmentRenderer::WaterSurfaceTechnique::refrMinFilter (  )  const [inline]

VRS::TextureGL::FilterMode EnvironmentRenderer::WaterSurfaceTechnique::refrMagFilter (  )  const [inline]

VRS::SO<VRS::Texture2DGL> EnvironmentRenderer::WaterSurfaceTechnique::getReflectionTexture ( VRS::SO< WaterSurface watersurface  ) 

These functions return the current reflection-/refraction-textures for the given watersurface.

If the watersurface is not contained in the current set of surfaces or the texture does not exist, the functions return NULL.

VRS::SO<VRS::Texture2DGL> EnvironmentRenderer::WaterSurfaceTechnique::getRefractionTexture (  ) 

VRS::SO<VRS::Texture2DGL> EnvironmentRenderer::WaterSurfaceTechnique::getMaskTexture (  ) 

void EnvironmentRenderer::WaterSurfaceTechnique::registerBackgroundTechnique ( VRS::SO< VRS::BackgroundGL background  ) 

If a background is used, it should be also reflected in water surfaces.

For this, the background technique must be registered, because skytechnique and background technique do not work properly together automatically. if 'background' is set to NULL a previously set background is removed and the default background color (black) is used.

void EnvironmentRenderer::WaterSurfaceTechnique::setTextureSize ( unsigned int  width,
unsigned int  height 
)

The default texturesize is 512x512.

Values smaller than half of the canvas' size will blur the reflection. For very small values (smaller than one fourth of the canvas' size) aliasing becomes visible. Values larger than the canvas' size just slow down the rendering speed but do not introduce extra detail.

unsigned int EnvironmentRenderer::WaterSurfaceTechnique::getTextureWidth (  )  const

unsigned int EnvironmentRenderer::WaterSurfaceTechnique::getTextureHeight (  )  const

virtual void EnvironmentRenderer::WaterSurfaceTechnique::start ( VRS::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 EnvironmentRenderer::WaterSurfaceTechnique::stop ( VRS::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 EnvironmentRenderer::WaterSurfaceTechnique::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::WaterSurfaceTechnique::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 void EnvironmentRenderer::WaterSurfaceTechnique::nextPass ( VRS::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 EnvironmentRenderer::WaterSurfaceTechnique::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::WaterSurfaceTechnique::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::WaterSurfaceTechnique::canBeUsed ( VRS::Engine engine  )  const [virtual]

checks for the following extensions

  • GL_ARB_shader_objects
  • GL_ARB_vertex_shader
  • GL_ARB_fragment_shader
  • GL_ARB_texture_non_power_of_two
  • GL_EXT_framebuffer_object

Reimplemented from VRS::Technique.

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

EnvironmentRenderer::WaterSurfaceTechnique::VRS_SERIALIZABLE ( WaterSurfaceTechnique   ) 


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

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