proland::DrawRiversTask Class Reference
[rivers]

This class is used to draw multi-resolution Animated Rivers as described in Qizhi Yu's Thesis [Models of Animated Rivers for the Interactive Exploration of Landscapes - November 2008]. More...

#include <DrawRiversTask.h>

List of all members.

Classes

struct  TerrainInfo
 Information about a terrainNode, such as the corresponding particleProducer, elevation cache, display informations etc. More...

Public Member Functions

 DrawRiversTask (ptr< Program > renderTexProg, ptr< Program > particlesProg, ptr< ParticleProducer > particles, float timeStep=1.0f, bool drawParticles=false, ptr< WaveTile > tex=NULL, ptr< WaveTile > bedTex=NULL, float riverDepth=1.0f, float waveSlopeFactor=1.f, bool useOffscreenDepth=false)
 Creates a new DrawRiversTask.
virtual ~DrawRiversTask ()
 Deletes this DrawRiversTask.
virtual ptr< Task > getTask (ptr< Object > context)
 Returns the task(s) to be executed for this object.
ptr< ParticleProducer > getParticles () const
 Returns particles.

Protected Member Functions

 DrawRiversTask ()
 Creates a n uninitialized DrawRiversTask.
void init (ptr< Program > renderTexProg, ptr< Program > particlesProg, ptr< ParticleProducer > particles, float timeStep=1.0f, bool drawParticles=false, ptr< WaveTile > tex=NULL, ptr< WaveTile > bedTex=NULL, float riverDepth=1.0f, float waveSlopeFactor=1.0f, bool useOffscreenDepth=false)
 Initializes this DrawRiversTask.

Private Member Functions

void doDrawParticles (ptr< ParticleProducer > pp)
 Draws particles for a given Particle Producer.
void drawRivers ()
 Main method called for drawing rivers.

Private Attributes

ptr< Uniform1f > drawModeU
 Draw Mode.
ptr< Uniform1f > displayGridU
 Determines if the particle grid is displayed or not.
ptr< Uniform1f > sunEffectsU
 Whether sun effects are enabled or not.
ptr< Uniform1f > waveSlopeFactorU
 Factor for waves' size.
ptr< Uniform1f > riverDepthU
 River's depth.
ptr< Uniform1f > useBedTexU
 True if the user wants to display a bed texture under the river.
ptr< Uniform2f > screenSizeU
 Screen Size.
ptr< Uniform2f > gridSizeU
 Particles grid size.
ptr< UniformSampler > spriteParamTableU
 Table containing the particles parameters.
ptr< UniformSampler > uniformSpriteGridU
 Indirection table for particles.
ptr< UniformSampler > riverTexU
 The pre-rendered texture.
ptr< Uniform1f > particleSizeU
 Displayed Points' size.
ptr< Uniform2f > sizeU
 Displayed Points' size.
vector< TerrainInfoterrainInfos
 List of terrains used by the particle manager.
ptr< ParticleProducer > particles
 The TerainParticleManager used to create the flow.
ptr< Texture2D > spTable
 Sprites Param table.
ptr< Texture2D > usGrid
 Uniform Sprite Grid.
ptr< FrameBuffer > frameBuffer
 An offscreen FrameBuffer used to create the advected texture when in pre-advected drawing mode.
bool useOffscreenDepth
 Used to determine if we need to copy the Depth Buffer into a local texture so it will be accessible from GLSL context.
ptr< Texture2D > depthBuffer
 A copy of the Depth Buffer, or the Depth Buffer itself if using an offscreen Depth Buffer.
ptr< Texture2D > advectedTex
 Pre-rendering method resulting texture.
SceneManager * scene
 The SceneManager on which we want to draw rivers.
ParticleGrid * particleGrid
 The ParticleGrid used to store and copy particles to GPU.
ptr< LifeCycleParticleLayer > lifeCycleLayer
 The ParticleLayer that handles particles life cycle data.
ptr< ScreenParticleLayer > screenLayer
 The ParticleLayer that handles particles screen coordinates.
ptr< TerrainParticleLayer > terrainLayer
 The ParticleLayer that handles particles local coordinates.
float timeStep
 Time step at each frame.
bool drawParticles
 Determines whether we draw the particles or not.
bool drawVelocities
 Determines whether we draw the particles velocitiesor not.
bool drawGrid
 Determines if we display the grid or not.
bool sunEffects
 Determines whether we draw sun effects (reflectance.
MeshDisplayType drawMesh
 Determines the way we display the mesh.
ptr< Program > renderTexProg
 The GLSL Program used to draw pre-rendering texture.
ptr< Program > particlesProg
 The GLSL Program used to draw the particles.
ptr< WaveTileriverTex
 Texture used to render the river.
ptr< WaveTilebedTex
 Texture used to render the river bed.
ptr< Mesh< vec3f, unsigned int > > mesh
 Mesh used to draw the particles.
ptr< Mesh< vecParticle,
unsigned int > > 
particleMesh
 Mesh used to draw the particles.
bool initialized
 Determines whether we need to recover the list of terrains associated to this Task.
float riverDepth
 River's depth.
float waveSlopeFactor
 Factor for waves' size.

Detailed Description

This class is used to draw multi-resolution Animated Rivers as described in Qizhi Yu's Thesis [Models of Animated Rivers for the Interactive Exploration of Landscapes - November 2008].

See http://www-evasion.imag.fr/Membres/Qizhi.Yu/phd/ for more details about this work. It represents Rivers on 3 different scales :

Author:
Antoine Begault, Guillaume Piolat

Known bugs:


Constructor & Destructor Documentation

proland::DrawRiversTask::DrawRiversTask ( ptr< Program >  renderTexProg,
ptr< Program >  particlesProg,
ptr< ParticleProducer >  particles,
float  timeStep = 1.0f,
bool  drawParticles = false,
ptr< WaveTile tex = NULL,
ptr< WaveTile bedTex = NULL,
float  riverDepth = 1.0f,
float  waveSlopeFactor = 1.f,
bool  useOffscreenDepth = false 
)

Creates a new DrawRiversTask.

Parameters:
renderTexProg the GLSL Program used to draw the pre-rendering texture.
particlesProg the GLSL Program used to draw the particles.
particles the TerrainParticleManager used to create the flow.
timeStep time step at each frame. Changes the speed of the river.
drawParticles determines whether we draw the particles or not. Particles are drawn as colored dots.
tex the texture used to advect normals.
bedTex the texture used to draw the river bed.
riverDepth river's depth.
waveSlopeFactor factor for waves' size.
useOffscreenDepth used to determine if we need to copy the DepthBuffer.
virtual proland::DrawRiversTask::~DrawRiversTask (  )  [virtual]

Deletes this DrawRiversTask.

proland::DrawRiversTask::DrawRiversTask (  )  [protected]

Creates a n uninitialized DrawRiversTask.


Member Function Documentation

void proland::DrawRiversTask::doDrawParticles ( ptr< ParticleProducer >  pp  )  [private]

Draws particles for a given Particle Producer.

Parameters:
pp the particle producer to draw.
void proland::DrawRiversTask::drawRivers (  )  [private]

Main method called for drawing rivers.

Calls the TerrainParticleManager::timeStep() method to update PM. Updates sprites & sprites parameters tables. Draws Particles if required, and finally draws 3D animated Rivers.

ptr<ParticleProducer> proland::DrawRiversTask::getParticles (  )  const

Returns particles.

virtual ptr<Task> proland::DrawRiversTask::getTask ( ptr< Object >  context  )  [virtual]

Returns the task(s) to be executed for this object.

It checks which tiles ParticleProducer needs to produce, depending on the current view, and puts it in the returned TaskGraph. The corresponding TerainParticleManagers will be produced before the run() method call.

Parameters:
context see Method.
void proland::DrawRiversTask::init ( ptr< Program >  renderTexProg,
ptr< Program >  particlesProg,
ptr< ParticleProducer >  particles,
float  timeStep = 1.0f,
bool  drawParticles = false,
ptr< WaveTile tex = NULL,
ptr< WaveTile bedTex = NULL,
float  riverDepth = 1.0f,
float  waveSlopeFactor = 1.0f,
bool  useOffscreenDepth = false 
) [protected]

Initializes this DrawRiversTask.

See DrawRiversTask.


Member Data Documentation

ptr<Texture2D> proland::DrawRiversTask::advectedTex [private]

Pre-rendering method resulting texture.

Texture used to render the river bed.

See Q. Yu's paper for its requirement's.

ptr<Texture2D> proland::DrawRiversTask::depthBuffer [private]

A copy of the Depth Buffer, or the Depth Buffer itself if using an offscreen Depth Buffer.

ptr<Uniform1f> proland::DrawRiversTask::displayGridU [private]

Determines if the particle grid is displayed or not.

Determines if we display the grid or not.

MeshDisplayType proland::DrawRiversTask::drawMesh [private]

Determines the way we display the mesh.

ptr<Uniform1f> proland::DrawRiversTask::drawModeU [private]

Draw Mode.

Determines what will be drawn in the shader. Depends on MESH_DISPLAY_TYPE and drawParticles and drawVelocities.

Determines whether we draw the particles or not.

Particles are drawn as colored dots.

Determines whether we draw the particles velocitiesor not.

ptr<FrameBuffer> proland::DrawRiversTask::frameBuffer [private]

An offscreen FrameBuffer used to create the advected texture when in pre-advected drawing mode.

ptr<Uniform2f> proland::DrawRiversTask::gridSizeU [private]

Particles grid size.

Determines whether we need to recover the list of terrains associated to this Task.

ptr<LifeCycleParticleLayer> proland::DrawRiversTask::lifeCycleLayer [private]

The ParticleLayer that handles particles life cycle data.

ptr<Mesh<vec3f, unsigned int> > proland::DrawRiversTask::mesh [private]

Mesh used to draw the particles.

ParticleGrid* proland::DrawRiversTask::particleGrid [private]

The ParticleGrid used to store and copy particles to GPU.

ptr<Mesh<vecParticle, unsigned int> > proland::DrawRiversTask::particleMesh [private]

Mesh used to draw the particles.

ptr<ParticleProducer> proland::DrawRiversTask::particles [private]

The TerainParticleManager used to create the flow.

ptr<Uniform1f> proland::DrawRiversTask::particleSizeU [private]

Displayed Points' size.

The GLSL Program used to draw the particles.

The GLSL Program used to draw pre-rendering texture.

River's depth.

ptr<Uniform1f> proland::DrawRiversTask::riverDepthU [private]

River's depth.

Texture used to render the river.

See Q. Yu's paper for its requirement's.

ptr<UniformSampler> proland::DrawRiversTask::riverTexU [private]

The pre-rendered texture.

SceneManager* proland::DrawRiversTask::scene [private]

The SceneManager on which we want to draw rivers.

ptr<ScreenParticleLayer> proland::DrawRiversTask::screenLayer [private]

The ParticleLayer that handles particles screen coordinates.

ptr<Uniform2f> proland::DrawRiversTask::screenSizeU [private]

Screen Size.

ptr<Uniform2f> proland::DrawRiversTask::sizeU [private]

Displayed Points' size.

ptr<UniformSampler> proland::DrawRiversTask::spriteParamTableU [private]

Table containing the particles parameters.

ptr<Texture2D> proland::DrawRiversTask::spTable [private]

Sprites Param table.

Determines whether we draw sun effects (reflectance.

..).

ptr<Uniform1f> proland::DrawRiversTask::sunEffectsU [private]

Whether sun effects are enabled or not.

List of terrains used by the particle manager.

ptr<TerrainParticleLayer> proland::DrawRiversTask::terrainLayer [private]

The ParticleLayer that handles particles local coordinates.

Time step at each frame.

Changes the speed of the river.

ptr<UniformSampler> proland::DrawRiversTask::uniformSpriteGridU [private]

Indirection table for particles.

ptr<Uniform1f> proland::DrawRiversTask::useBedTexU [private]

True if the user wants to display a bed texture under the river.

Used to determine if we need to copy the Depth Buffer into a local texture so it will be accessible from GLSL context.

ptr<Texture2D> proland::DrawRiversTask::usGrid [private]

Uniform Sprite Grid.

Factor for waves' size.

Factor for waves' size.


Generated on Sat May 12 09:42:58 2012 for proland by  doxygen 1.6.1