Waterflow
Visualize water in terrain
|
Specialized version of height map that handles multiple drawing programs. More...
#include <myDrawable.h>
Inherits HeightMap.
Public Member Functions | |
Water (GLuint *drawPrograms, GLuint *sizes, GLfloat maxHeight, GLuint inputHeightBuffer) | |
Simple contructor. | |
Static Public Member Functions | |
static void TW_CALL | GetDrawProgramCB (void *value, void *clientData) |
Used by AntTweakBar to get current program used for drawing. | |
static void TW_CALL | GetMaxDepthCB (void *value, void *clientData) |
Used by AntTweakBar to get max depth. | |
static void TW_CALL | GetTransparencyCB (void *value, void *clientData) |
Used by AntTweakBar to get which texture is in use. | |
static void TW_CALL | SetDrawProgramCB (const void *value, void *clientData) |
Used by AntTweakBar to set which program should be used to draw. | |
static void TW_CALL | SetMaxDepthCB (const void *value, void *clientData) |
Used by AntTweakBar to set max depth. | |
static void TW_CALL | SetTransparencyCB (const void *value, void *clientData) |
Used by AntTweakBar to set which texture to use. | |
Private Member Functions | |
void | initDepthProgram () |
For water some additional parameters needs to be set. | |
Private Attributes | |
GLfloat | maxDepth |
Depth drawn as black in the depth shader. | |
GLuint | programs [2] |
Program to toggle between (1 = normal, 2 = depth shader) | |
GLint | programToDraw |
Which program to use when drawing. | |
GLfloat | transparency |
Tranparancy of the water. | |
GLuint | vaos [2] |
Which VAO to use for drawing. |
Specialized version of height map that handles multiple drawing programs.
Currently has the possibility of drawing two different programs and some special parameters.
Definition at line 167 of file myDrawable.h.
Water::Water | ( | GLuint * | drawPrograms, |
GLuint * | sizes, | ||
GLfloat | maxHeight, | ||
GLuint | inputHeightBuffer | ||
) |
Simple contructor.
Takes a few parameters for initial setup of the size of the height map data.
drawPrograms | The initial program to use for drawing the model |
sizes | Width and Height of the data |
maxHeight | The height map maximum height (low assumed to be 0) |
inputHeightBuffer | Buffer ID of the height map data |
Definition at line 348 of file myDrawable.cpp.
void Water::initDepthProgram | ( | ) | [private] |
For water some additional parameters needs to be set.
Creates extra VAO's for use with the other programs, still references the same buffers though but for depth drawing we done need normals.
Definition at line 367 of file myDrawable.cpp.