molecular
|
Draw heightmap terrain. More...
#include <DrawTerrain.h>
Public Member Functions | |
template<class TRenderManager > | |
DrawTerrain (TRenderManager &manager) | |
~DrawTerrain () | |
void | Execute () override |
util::AxisAlignedBox | GetBounds () const override |
void | SetHeightScale (float scale) |
Set scaling factor for heightmap values. More... | |
void | SetSize (float xSize, float ySize) |
Set drawing size of terrain. More... | |
void | SetHeightmapData (unsigned int width, unsigned int height, const float *data) |
Set heightmap data from array of floats. More... | |
void | SetTestData (unsigned int width, unsigned int height) |
Set heightmap to a 2D sine pattern for testing purposes. More... | |
void | SetLodFactor (float factor) |
Set factor which decides on the LOD level from distance to viewer. More... | |
void | SetPickingId (unsigned int id) |
![]() | |
template<class TRenderManager > | |
DrawingFunction (TRenderManager &manager) | |
bool | BoundsChangedSince (int framecounter) const override |
![]() | |
template<class TRenderManager > | |
RenderFunction (TRenderManager &manager) | |
RenderFunction (Scoping &scoping, RenderCmdSink &renderer) | |
virtual | ~RenderFunction () |
virtual void | Set (Hash, bool) |
Set bool property with given name. More... | |
Additional Inherited Members | |
![]() | |
RenderCmdSink::Program * | PrepareProgram () |
![]() | |
template<class T > | |
const T * | GetVariable (Hash key) |
Convenience shortcut to a variable pointer from the dynamic scope. More... | |
![]() | |
ProgramProvider & | mProgramProvider |
![]() | |
Scoping & | mScoping |
RenderCmdSink & | mRenderer |
Draw heightmap terrain.
Divides the terrain into patches of size kPatchSize. Stores heightmap data in a texture that is evaluated in the vertex shader. Does level of detail calculations. Origin of the terrain mesh is the corner with heightmap index 0,0.
Frustum culling for individual patches.
Skirting to hide seams between patches with different LOD.
Mipmapping. Right now, simple subsampling is used for lower LOD.
molecular::gfx::DrawTerrain::DrawTerrain | ( | TRenderManager & | manager | ) |
molecular::gfx::DrawTerrain::~DrawTerrain | ( | ) |
|
overridevirtual |
Implements molecular::gfx::RenderFunction.
|
overridevirtual |
Implements molecular::gfx::RenderFunction.
void molecular::gfx::DrawTerrain::SetHeightmapData | ( | unsigned int | width, |
unsigned int | height, | ||
const float * | data | ||
) |
Set heightmap data from array of floats.
|
inline |
Set scaling factor for heightmap values.
Defaults to 1.
|
inline |
Set factor which decides on the LOD level from distance to viewer.
|
inline |
void molecular::gfx::DrawTerrain::SetSize | ( | float | xSize, |
float | ySize | ||
) |
Set drawing size of terrain.
Terrain is always drawn with these dimensions, regardless of heightmap sample count.
void molecular::gfx::DrawTerrain::SetTestData | ( | unsigned int | width, |
unsigned int | height | ||
) |
Set heightmap to a 2D sine pattern for testing purposes.