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

Public Types | |
| enum | PassNumbers { PRE = 0, INITCAMERA = 1, MAIN = 100, POST = 1000 } |
Public Member Functions | |
| Technique () | |
| Scene graph evaluation strategy. | |
| virtual void | start (Engine *) |
| virtual void | stop (Engine *) |
| virtual void | activatePass (int pass) |
| virtual bool | preparePass (Engine *)=0 |
| virtual void | finishPass (Engine *)=0 |
| virtual void | nextPass (Engine *) |
| virtual bool | usesPass (int pass) const |
| virtual bool | prepareEval (Engine *engine, const Shape *shape)=0 |
| virtual void | finishEval (Engine *engine, const Shape *shape)=0 |
| virtual ID | target () const |
| virtual bool | canBeUsed (Engine *) const |
| VRS_SERIALIZABLE_CLASS_ENUM (PassNumbers) | |
| VRS_TYPEINFO (Technique, RenderObj) | |
Protected Member Functions | |
| void | registerPass (int pass) |
| int | getPass () const |
| Returns the identifier of the current pass. | |
Static Protected Member Functions | |
| static void | addPass (Engine *, int pass) |
| VRS::Technique::Technique | ( | ) |
Scene graph evaluation strategy.
A Technique is a rendering strategy for a scene graph in VRS. Several techniques may be used in combination when evaluating a scene graph.
A Technique contains an array of identifiers (e.g., ints) denoting rendering passes. The collected identifiers of all techniques in the scene graph denote the order in which the rendering passes of all techniques are invoked. During a rendering pass, several methods of the active techniques (e.g., techniques whose pass array contains the actual rendering pass) are called, in which rendering settings etc. of the underlying rendering system may be changed. It is perfectly legal in a rendering pass to have more than one active technique.
Note that for a technique present in the scene graph to take effect, the scene graph has to be evaluated with a TechniqueProcessor. Such a processor is responsible for collecting the techniques during the pretraversal of the scene graph, maintaining a list of all rendering passes that are needed to evaluate a scene graph and invoking the methods of the techniques. If you use a GlutCanvas or TclCanvas, you automatically have a suitable RenderingProcessorGL.
| virtual void VRS::Technique::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 in EnvironmentRenderer::WaterSurfaceTechnique, VRS::AlternativeTechniqueGL, VRS::CubeEnvMirrorTechniqueGL, VRS::MainTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, VRS::TextureEdgesTechniqueGL, VRS::TextureMirrorTechniqueGL, VRS::TransparencyTechniqueGL, VRS::RayRequestTechnique, and VRS::RayTracingTechnique.
| virtual void VRS::Technique::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 in VRS::CameraTechnique, EnvironmentRenderer::WaterSurfaceTechnique, VRS::AlternativeTechniqueGL, VRS::CubeEnvMirrorTechniqueGL, VRS::MainTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, VRS::TextureMirrorTechniqueGL, VRS::RayRequestTechnique, and VRS::RayTracingTechnique.
| virtual void VRS::Technique::activatePass | ( | int | pass | ) | [virtual] |
Reports to an active technique the identifier of the rendering pass next to come.
Reimplemented in VRS::ShadowTechniqueGL.
| virtual bool VRS::Technique::preparePass | ( | Engine * | ) | [pure 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.
Implemented in VRS::CameraTechnique, EnvironmentRenderer::SkyTechnique, EnvironmentRenderer::WaterSurfaceTechnique, VRS::MainTechnique, VRS::AlternativeTechniqueGL, VRS::BackgroundGL, VRS::CubeEnvMirrorTechniqueGL, VRS::HaloTechniqueGL, VRS::MainTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, VRS::TextureEdgesTechniqueGL, VRS::TextureMirrorTechniqueGL, VRS::TransparencyTechniqueGL, VRS::PosttraversalTechnique, VRS::PretraversalTechnique, and VRS::RayRequestTechnique.
| virtual void VRS::Technique::finishPass | ( | Engine * | ) | [pure 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
Implemented in VRS::CameraTechnique, EnvironmentRenderer::SkyTechnique, EnvironmentRenderer::WaterSurfaceTechnique, VRS::MainTechnique, VRS::AlternativeTechniqueGL, VRS::BackgroundGL, VRS::CubeEnvMirrorTechniqueGL, VRS::HaloTechniqueGL, VRS::MainTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, VRS::TextureEdgesTechniqueGL, VRS::TextureMirrorTechniqueGL, VRS::TransparencyTechniqueGL, VRS::PosttraversalTechnique, VRS::PretraversalTechnique, and VRS::RayRequestTechnique.
| virtual void VRS::Technique::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 in EnvironmentRenderer::WaterSurfaceTechnique, VRS::AlternativeTechniqueGL, VRS::CubeEnvMirrorTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, and VRS::TextureMirrorTechniqueGL.
| virtual bool VRS::Technique::usesPass | ( | int | pass | ) | const [virtual] |
Checks whether an identifier for a rendering pass is contained in the pass array.
Reimplemented in VRS::MirrorTechniqueGL, and VRS::ShadowTechniqueGL.
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.
Implemented in VRS::CameraTechnique, EnvironmentRenderer::SkyTechnique, EnvironmentRenderer::WaterSurfaceTechnique, VRS::MainTechnique, VRS::AlternativeTechniqueGL, VRS::BackgroundGL, VRS::CubeEnvMirrorTechniqueGL, VRS::HaloTechniqueGL, VRS::MainTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, VRS::TextureEdgesTechniqueGL, VRS::TextureMirrorTechniqueGL, VRS::TransparencyTechniqueGL, VRS::PosttraversalTechnique, VRS::PretraversalTechnique, and VRS::RayRequestTechnique.
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.
Implemented in VRS::CameraTechnique, EnvironmentRenderer::SkyTechnique, EnvironmentRenderer::WaterSurfaceTechnique, VRS::MainTechnique, VRS::AlternativeTechniqueGL, VRS::BackgroundGL, VRS::CubeEnvMirrorTechniqueGL, VRS::HaloTechniqueGL, VRS::MainTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::SurfaceStyleTechniqueGL, VRS::TextureEdgesTechniqueGL, VRS::TextureMirrorTechniqueGL, VRS::TransparencyTechniqueGL, VRS::PosttraversalTechnique, VRS::PretraversalTechnique, and VRS::RayRequestTechnique.
| virtual ID VRS::Technique::target | ( | ) | const [virtual] |
TechniqueProcessor for which this technique works. For example, some techniques only make sense for the specilized OpenGL TechniqueProcessorGL. Such techniques should overide the "target()" of the base technique.
Reimplemented in VRS::TechniqueGL.
| virtual bool VRS::Technique::canBeUsed | ( | Engine * | ) | const [virtual] |
May check for extensions of the low rendering system which would be necessary for the technique to run.
Reimplemented in EnvironmentRenderer::SkyTechnique, EnvironmentRenderer::WaterSurfaceTechnique, VRS::AlternativeTechniqueGL, VRS::CubeEnvMirrorTechniqueGL, VRS::HaloTechniqueGL, VRS::MirrorTechniqueGL, VRS::ShadowTechniqueGL, VRS::ShadowTechniqueTemplateGL, VRS::SilhouetteStyleTechniqueGL, VRS::TextureEdgesTechniqueGL, and VRS::TextureMirrorTechniqueGL.
| VRS::Technique::VRS_SERIALIZABLE_CLASS_ENUM | ( | PassNumbers | ) |
Identifier of rendering passes of techniques which can be used with a TechniqueProcessor.
| void VRS::Technique::registerPass | ( | int | pass | ) | [protected] |
Adds a pass to list of passes for which the technique is responsable, i.e., for which the technique will be active. This method is used in the constructor of a derived technique and then it is never used again.
| int VRS::Technique::getPass | ( | ) | const [inline, protected] |
Returns the identifier of the current pass.
| static void VRS::Technique::addPass | ( | Engine * | , | |
| int | pass | |||
| ) | [static, protected] |
Adds a pass to the current TechniqueProcessor. Required for techniques for which it is unknown how many passes they need, used by start(Engine*) as well.