Heightfield 1.0
GPU_Deposition Class Reference

A sediment deposition simulation on the GPU. Simulation only adds matter on a given bedrock. More...

#include <gpusediment.h>

Public Member Functions

 GPU_Deposition ()
 Constructor.
 ~GPU_Deposition ()
 Destructor.
void Init (const HeightField &)
 GPU buffers initialization from given heightfield. Shader and Uniforms are also initialized.
void SetSourceMap (const ScalarField2 &)
 Sets a source map for the sediments. Sediments will be produced by the source map, and transported everywhere according to the simulation.
void Step (int)
 Launches nb_steps steps of the deposition simulation.
void SetUniforms (float deposition_strength)
 Set the uniform variable associated to deposition strength.
void GetHeight (ScalarField2 &hf)
 Gets the elevation data back to the CPU.
void GetStream (ScalarField2 &hf)
 Gets the sediment stream data back to the CPU.
void GetSed (ScalarField2 &hf)
 Gets the added sediment data back to the CPU.
void GetDebug (ScalarField2 &hf)
 Gets the debug data back to the CPU. The content of the debug buffer can be modified in the shader.

Detailed Description

A sediment deposition simulation on the GPU. Simulation only adds matter on a given bedrock.

Member Function Documentation

◆ GetDebug()

void GPU_Deposition::GetDebug ( ScalarField2 & sf)

Gets the debug data back to the CPU. The content of the debug buffer can be modified in the shader.

Parameters
sfScalarField to store the debug data.

◆ GetHeight()

void GPU_Deposition::GetHeight ( ScalarField2 & sf)

Gets the elevation data back to the CPU.

Parameters
sfScalarField to store the elevation data.

◆ GetSed()

void GPU_Deposition::GetSed ( ScalarField2 & sf)

Gets the added sediment data back to the CPU.

Parameters
sfScalarField to store the added sediment data.

◆ GetStream()

void GPU_Deposition::GetStream ( ScalarField2 & sf)

Gets the sediment stream data back to the CPU.

Parameters
sfScalarField to store the stream data.

◆ Init()

void GPU_Deposition::Init ( const HeightField & hf)

GPU buffers initialization from given heightfield. Shader and Uniforms are also initialized.

Parameters
hfHeightfield to be used as bedrock.

◆ SetSourceMap()

void GPU_Deposition::SetSourceMap ( const ScalarField2 & source_map)

Sets a source map for the sediments. Sediments will be produced by the source map, and transported everywhere according to the simulation.

Parameters
source_mapScalarField to be used as source map.

◆ SetUniforms()

void GPU_Deposition::SetUniforms ( float deposition_strength)

Set the uniform variable associated to deposition strength.

Parameters
deposition_strengthDeposition strength value.

◆ Step()

void GPU_Deposition::Step ( int nb_steps)

Launches nb_steps steps of the deposition simulation.

Parameters
nb_stepsNumber of simulation steps to launch.