| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/environment/watersurfacetechnique.h>

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::Texture2DGL > | getReflectionTexture (VRS::SO< WaterSurface > watersurface) |
| These functions return the current reflection-/refraction-textures for the given watersurface. | |
| VRS::SO< VRS::Texture2DGL > | getRefractionTexture () |
| VRS::SO< VRS::Texture2DGL > | getMaskTexture () |
| 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
| |
| VRS_TYPEINFO (WaterSurfaceTechnique, VRS::TechniqueGL) | |
| VRS_SERIALIZABLE (WaterSurfaceTechnique) | |
Classes | |
| struct | WaterSurfaceData |
| structure which stores render targets and other per-watersurface data | |
| 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
| 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
Reimplemented from VRS::Technique.
| EnvironmentRenderer::WaterSurfaceTechnique::VRS_TYPEINFO | ( | WaterSurfaceTechnique | , | |
| VRS::TechniqueGL | ||||
| ) |
| EnvironmentRenderer::WaterSurfaceTechnique::VRS_SERIALIZABLE | ( | WaterSurfaceTechnique | ) |