Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
#include <Terrain.hpp>

Some applications do not need complex LOD or CLOD management algorithms to display height fields or terrains, either because the data displayed has a limited size or because particular constraints are applied to the camera (like in RTS games for example) for which only a limited portion of the terrain is visible at a given time.
This applications can greatly benefit from the vl::Terrain scene manager which implements a fool-proof, high-precision (8, 16 and 32 bits heightmaps are supported) and efficient terrain/heightfield generation and management system. All the user has to provide is a texture for the terrain, a heightfield image and a detail texture following very simple and precise guidelines.
The vl::Terrain class takes care of all the rest, like dividing the provided images into chunks, generating the geometry, generating the kd-tree, computing the appropriate texture coordinates in order to prevent seams and so on.
If the OpenGL Shading Language is available, the vl::Terrain class can also store the heightmap directly on the GPU and can generate the geometry on the fly using a technique called "vertex texture fetch" (http://developer.nvidia.com/object/using_vertex_textures.html). This technique allows the application to save GPU memory and to manage even greater terrain databases at a higher speed.
| vl::Terrain::Terrain | ( | ) | [inline] |
| virtual const char* vl::Terrain::className | ( | ) | [inline, virtual] |
| void Terrain::init | ( | ) |
| bool vl::Terrain::useGLSL | ( | ) | const [inline] |
| int vl::Terrain::detailRepetitionMode | ( | ) | const [inline] |
| double vl::Terrain::width | ( | ) | const [inline] |
| double vl::Terrain::depth | ( | ) | const [inline] |
| double vl::Terrain::height | ( | ) | const [inline] |
| const vec3& vl::Terrain::origin | ( | ) | const [inline] |
| const String& vl::Terrain::detailTexture | ( | ) | const [inline] |
| const String& vl::Terrain::terrainTexture | ( | ) | const [inline] |
| const String& vl::Terrain::heightmapTexture | ( | ) | const [inline] |
| ETextureFormat vl::Terrain::heightmapTextureFormat | ( | ) | const [inline] |
| ETextureFormat vl::Terrain::terrainTextureFormat | ( | ) | const [inline] |
| ETextureFormat vl::Terrain::detailTextureFormat | ( | ) | const [inline] |
| void vl::Terrain::setUseGLSL | ( | bool | enable | ) | [inline] |
| void vl::Terrain::setDetailRepetitionCount | ( | int | count | ) | [inline] |
| void vl::Terrain::setWidth | ( | double | w | ) | [inline] |
| void vl::Terrain::setDepth | ( | double | d | ) | [inline] |
| void vl::Terrain::setHeight | ( | double | h | ) | [inline] |
| void vl::Terrain::setOrigin | ( | const vec3 & | origin | ) | [inline] |
| void vl::Terrain::setHeightmapTextureFormat | ( | ETextureFormat | format | ) | [inline] |
| void vl::Terrain::setTerrainTextureFormat | ( | ETextureFormat | format | ) | [inline] |
| void vl::Terrain::setDetailTextureFormat | ( | ETextureFormat | format | ) | [inline] |
| void vl::Terrain::setVertexShader | ( | const String & | vs_path | ) | [inline] |
| const String& vl::Terrain::vertexShader | ( | ) | const [inline] |
| void vl::Terrain::setFragmentShader | ( | const String & | fs_path | ) | [inline] |
| const String& vl::Terrain::fragmentShader | ( | ) | const [inline] |
| const ActorCollection& vl::Terrain::chunks | ( | ) | const [inline] |
| int vl::Terrain::chunkCount | ( | ) | const [inline] |
| Actor* vl::Terrain::chunk | ( | int | i | ) | [inline] |
| const Actor* vl::Terrain::chunk | ( | int | i | ) | const [inline] |
| void vl::Terrain::setDetailTexture | ( | const String & | texture | ) | [inline] |
Sets the texture to be used as detail texture, it can be of any size.
| void vl::Terrain::setTerrainTexture | ( | const String & | texture | ) | [inline] |
Sets the texture to be used as the base terrain texture.
Its size must be of the form: n * d - n + 1 where:
| void vl::Terrain::setHeightmapTexture | ( | const String & | texture | ) | [inline] |
Sets the texture to be used as the heightmap.
Its size must be of the form: n * d - n + 1 where:
| const ShaderNode* vl::Terrain::shaderNode | ( | ) | const [inline] |
| ShaderNode* vl::Terrain::shaderNode | ( | ) | [inline] |
ref<ShaderNode> vl::Terrain::mShaderNode [protected] |
ActorCollection vl::Terrain::mChunks [protected] |
double vl::Terrain::mWidth [protected] |
double vl::Terrain::mHeight [protected] |
double vl::Terrain::mDepth [protected] |
vec3 vl::Terrain::mOrigin [protected] |
String vl::Terrain::mDetailTexture [protected] |
String vl::Terrain::mTerrainTexture [protected] |
String vl::Terrain::mHeightmapTexture [protected] |
String vl::Terrain::mVertexShader [protected] |
String vl::Terrain::mFragmentShader [protected] |
int vl::Terrain::mDetailRepetitionCount [protected] |
ETextureFormat vl::Terrain::mHeightmapTextureFormat [protected] |
ETextureFormat vl::Terrain::mTerrainTextureFormat [protected] |
ETextureFormat vl::Terrain::mDetailTextureFormat [protected] |
bool vl::Terrain::mUseGLSL [protected] |