#include <soarxterrainrenderer.h>

Public Types | |
| typedef std::map < dtCore::RefPtr < PagedTerrainTile >, DrawableEntry > | DrawableMap |
| Help minimize some typing... | |
Public Member Functions | |
| SoarXTerrainRenderer (const std::string &name="SoarXRenderer") | |
| Constructs the SoarX renderer. | |
| void | OnLoadTerrainTile (PagedTerrainTile &tile) |
| This method constructs a SoarXDrawable for the new terrain tile that needs to be loaded. | |
| void | OnUnloadTerrainTile (PagedTerrainTile &tile) |
| This method updates an internal map of tiles and drawables based on what tiles were unloaded from the terrain. | |
| float | GetHeight (float x, float y) |
| Gets the height of the terrain at the specified (x,y) coordinates. | |
| osg::Vec3 | GetNormal (float x, float y) |
| Gets the normal vector at the specified point. | |
| osg::Group * | GetRootDrawable () |
| Returns a scene node that encapsulates the renderable terrain. | |
| void | SetDetailMultiplier (float value) |
| Sets the detail multiplier on the SoarX drawable. | |
| float | GetDetailMultiplier () const |
| Gets the current detail multiplier. | |
| void | SetThreshold (float value) |
| Sets the threshold value of the SoarXDrawable. | |
| float | GetThreshold () const |
| Gets the threshold value of the SoarXDrawable. | |
| void | SetTerrainFragmentShader (const std::string &filePath) |
| Sets the file containing the fragment shader to use when rendering the terrain. | |
| const std::string & | GetTerrainFragmentShader () const |
| Gets the file name containing the fragment shader currently in use by the terrain renderer. | |
| void | SetEnableFog (bool pEnableFog) |
| Tells the terrain whether or not to use the fog variables when rendering the terrain by default there is no fog. | |
Static Public Attributes | |
| static const float | GRADIENT_SCALE = 32.0f |
| Used to scale the precalculated gradient values used to render the terrain. | |
Protected Member Functions | |
| virtual | ~SoarXTerrainRenderer () |
| Destroy the renderer. | |
| void | InitializeRenderer () |
| This method initializes data for this renderer that is shared amoungst the terrain tiles. | |
| void | CreateFragmentShader () |
| Creates the GLSL program object. | |
| void | SetupRenderState (PagedTerrainTile &tile, DrawableEntry &entry, osg::StateSet &ss) |
| Configures the specified drawable and stateset to use the proper textures and render state for SoarX terrain renderering. | |
| void | CheckDetailNoiseCache () |
| Attempts to load the detail noise data from the terrain cache. | |
| void | CheckDetailGradientCache () |
| Checks the cache for a detail gradient texture. | |
| void | CheckDetailScaleCache () |
| Checks the cache for a detail scale map. | |
| void | CheckBaseGradientCache (const PagedTerrainTile &tile, DrawableEntry &entry) |
| This method is called for each tile that is loaded. | |
| void | CalculateDetailNoise () |
| Builds an array of noise values used to dynamically add more detail to the terrain. | |
Classes | |
| struct | DrawableEntry |
| This structure represents a drawable tile. More... | |
The SoarX algorithm is an extension of the original SOAR (Stateless One-pass Adaptive Refinement) algorithm developed by Peter Lindstrom and Valerio Pascucci. The SOAR algorithm itself has several components and features including adaptive refinement, on-the-fly triangle stripping and smooth geomorphing based on projected error. The SoarX implementation extends and improves on some of the shortcomings of the original SOAR terrain rendering solution. The original SoarX algorithm and demo application developed by Andras Balogh can be found at http://web.interware.hu/bandi/ranger.html.
| typedef std::map<dtCore::RefPtr<PagedTerrainTile>,DrawableEntry> dtTerrain::SoarXTerrainRenderer::DrawableMap |
Help minimize some typing...
| dtTerrain::SoarXTerrainRenderer::SoarXTerrainRenderer | ( | const std::string & | name = "SoarXRenderer" |
) |
Constructs the SoarX renderer.
| name | Simple name to assign to this object. Default = "SoarXRenderer" |
| dtTerrain::SoarXTerrainRenderer::~SoarXTerrainRenderer | ( | ) | [protected, virtual] |
Destroy the renderer.
| void dtTerrain::SoarXTerrainRenderer::OnLoadTerrainTile | ( | PagedTerrainTile & | tile | ) | [virtual] |
This method constructs a SoarXDrawable for the new terrain tile that needs to be loaded.
| tile | The new tile. |
Implements dtTerrain::TerrainDataRenderer.
| void dtTerrain::SoarXTerrainRenderer::OnUnloadTerrainTile | ( | PagedTerrainTile & | tile | ) | [virtual] |
This method updates an internal map of tiles and drawables based on what tiles were unloaded from the terrain.
| tile | The tile being unloaded. |
Reimplemented from dtTerrain::TerrainDataRenderer.
| float dtTerrain::SoarXTerrainRenderer::GetHeight | ( | float | x, | |
| float | y | |||
| ) | [virtual] |
Gets the height of the terrain at the specified (x,y) coordinates.
Implements dtTerrain::TerrainDataRenderer.
| osg::Vec3 dtTerrain::SoarXTerrainRenderer::GetNormal | ( | float | x, | |
| float | y | |||
| ) | [virtual] |
Gets the normal vector at the specified point.
Implements dtTerrain::TerrainDataRenderer.
| osg::Group* dtTerrain::SoarXTerrainRenderer::GetRootDrawable | ( | ) | [inline, virtual] |
Returns a scene node that encapsulates the renderable terrain.
Implements dtTerrain::TerrainDataRenderer.
| void dtTerrain::SoarXTerrainRenderer::SetDetailMultiplier | ( | float | value | ) |
| float dtTerrain::SoarXTerrainRenderer::GetDetailMultiplier | ( | ) | const |
Gets the current detail multiplier.
| void dtTerrain::SoarXTerrainRenderer::SetThreshold | ( | float | value | ) |
| float dtTerrain::SoarXTerrainRenderer::GetThreshold | ( | ) | const |
| void dtTerrain::SoarXTerrainRenderer::SetTerrainFragmentShader | ( | const std::string & | filePath | ) | [inline] |
Sets the file containing the fragment shader to use when rendering the terrain.
| filePath | The path to the shader file. This path is relative to the Delta3D data path list. The default path is "shaders/terrain.frag". |
| const std::string& dtTerrain::SoarXTerrainRenderer::GetTerrainFragmentShader | ( | ) | const [inline] |
Gets the file name containing the fragment shader currently in use by the terrain renderer.
| void dtTerrain::SoarXTerrainRenderer::SetEnableFog | ( | bool | pEnableFog | ) |
Tells the terrain whether or not to use the fog variables when rendering the terrain by default there is no fog.
| void dtTerrain::SoarXTerrainRenderer::InitializeRenderer | ( | ) | [protected] |
This method initializes data for this renderer that is shared amoungst the terrain tiles.
This includes shaders, textures, some of which are read from the cache if it exists.
| void dtTerrain::SoarXTerrainRenderer::CreateFragmentShader | ( | ) | [protected] |
Creates the GLSL program object.
| void dtTerrain::SoarXTerrainRenderer::SetupRenderState | ( | PagedTerrainTile & | tile, | |
| DrawableEntry & | entry, | |||
| osg::StateSet & | ss | |||
| ) | [protected] |
Configures the specified drawable and stateset to use the proper textures and render state for SoarX terrain renderering.
| void dtTerrain::SoarXTerrainRenderer::CheckDetailNoiseCache | ( | ) | [protected] |
Attempts to load the detail noise data from the terrain cache.
If it is not present, the data will be generated.
| void dtTerrain::SoarXTerrainRenderer::CheckDetailGradientCache | ( | ) | [protected] |
Checks the cache for a detail gradient texture.
If found, it will load it else it will be generated and then cached if enabled.
| void dtTerrain::SoarXTerrainRenderer::CheckDetailScaleCache | ( | ) | [protected] |
Checks the cache for a detail scale map.
If found, it will load it, else the data will be generated then cached if enabled.
| void dtTerrain::SoarXTerrainRenderer::CheckBaseGradientCache | ( | const PagedTerrainTile & | tile, | |
| DrawableEntry & | entry | |||
| ) | [protected] |
This method is called for each tile that is loaded.
It checks to see if there is a gradient texture in the tile's cache path and if so loads it. If not, the gradient texture is generated and cached if enabled.
| void dtTerrain::SoarXTerrainRenderer::CalculateDetailNoise | ( | ) | [protected] |
Builds an array of noise values used to dynamically add more detail to the terrain.
const float dtTerrain::SoarXTerrainRenderer::GRADIENT_SCALE = 32.0f [static] |
Used to scale the precalculated gradient values used to render the terrain.