Eulerian Smoke Simulation on the GPU
|
An OpenCL gas solver, that writes the simulation fields to 3D OpenGL textures. More...
#include <GasSolver.h>
Public Types | |
enum | DrivingFunction { NONE, SIN, COS, TAN } |
Public Member Functions | |
GasSolver (int _w, int _h, int _d, ComputeEngine *_compute, ImageUnitStack *_imageUnitStack) | |
Constructor. | |
~GasSolver () | |
Destructor. | |
void | init () |
Initialization function. | |
void | update () |
Update function. | |
void | updateObstacleData () |
Updates the obstacle data. | |
PingPongVolume * | getVelocity () const |
Accessor for the velocity ping-pong volume. | |
PingPongVolume * | getPressure () const |
Accessor for the pressure ping-pong volume. | |
PingPongVolume * | getTemperature () const |
Accessor for the temperature ping-pong volume. | |
PingPongVolume * | getDensity () const |
Accessor for the density ping-pong volume. | |
Obstacle * | getObstacles () const |
Accessor for the simulation obstacles. | |
void | setCellSize (float _cellSize) |
Sets the simulation's cell size. | |
void | setSplatRadius (float _splatRadius) |
Sets the splat radius. | |
void | setAmbientTemperature (float _ambientTemperature) |
Sets the ambient temperature. | |
void | setImpulseTemperature (float _impulseTemperature) |
Sets the impulse temperature. | |
void | setImpulseDensity (float _impulseDensity) |
Sets the impulse density. | |
void | setImpulsePosition (float _posX, float _posY, float _posZ) |
Sets the impulse position. | |
void | setPoissonIterations (int _numPoissonIterations) |
Sets the number of iterations of the Poisson solver. | |
void | setTimestep (float _timestep) |
Sets the time-step. | |
void | setBuoyancyLift (float _buoyancyLift) |
Sets the buoyancy lift factor. | |
void | setBuoyancyDirection (float _dirX, float _dirY, float _dirZ) |
Sets the buoyancy force direction. | |
void | togglePeriodicNoise (bool _enablePeriodicNoise) |
Toggles the periodic noise function. | |
void | setNoiseVariance (float _noiseVarianceX, float _noiseVarianceY, float _noiseVarianceZ) |
Sets the periodic noise variance. | |
void | setNoiseDrivingFunc (int _funcIndexX, int _funcIndexY, int _funcIndexZ) |
Sets the periodic noise driving function. | |
void | setGasWeight (float _gasWeight) |
Sets the gas' weight. | |
void | setTemperatureDissipation (float _temperatureDissipation) |
Sets the temperature dissipation factor. | |
void | setDensityDissipation (float _densityDissipation) |
Sets the density dissipation factor. | |
void | setVelocityDissipation (float _velocityDissipation) |
Sets the velocity dissipation factor. |
An OpenCL gas solver, that writes the simulation fields to 3D OpenGL textures.
GasSolver::GasSolver | ( | int | _w, |
int | _h, | ||
int | _d, | ||
ComputeEngine * | _compute, | ||
ImageUnitStack * | _imageUnitStack | ||
) |
Constructor.
[in] | _w | the simulation grid width |
[in] | _h | the simulation grid height |
[in] | _d | the simulation grid depth |
[in] | _compute | the instance of the compute engine to use |
void GasSolver::setAmbientTemperature | ( | float | _ambientTemperature | ) | [inline] |
Sets the ambient temperature.
[in] | _ambientTemperature | the new ambient temperature |
void GasSolver::setBuoyancyDirection | ( | float | _dirX, |
float | _dirY, | ||
float | _dirZ | ||
) | [inline] |
Sets the buoyancy force direction.
[in] | _dirX | the direction in X |
[in] | _dirY | the direction in Y |
[in] | _dirZ | the direction in Z |
void GasSolver::setBuoyancyLift | ( | float | _buoyancyLift | ) | [inline] |
Sets the buoyancy lift factor.
[in] | _buoyancyLift | the new buoyancy lift constant |
void GasSolver::setCellSize | ( | float | _cellSize | ) | [inline] |
Sets the simulation's cell size.
[in] | _cellSize | the new cell size |
void GasSolver::setDensityDissipation | ( | float | _densityDissipation | ) | [inline] |
Sets the density dissipation factor.
[in] | _densityDissipation | the new density dissipation |
void GasSolver::setGasWeight | ( | float | _gasWeight | ) | [inline] |
Sets the gas' weight.
[in] | _gasWeight | the new gas weight |
void GasSolver::setImpulseDensity | ( | float | _impulseDensity | ) | [inline] |
Sets the impulse density.
[in] | _impulseDensity | the new impulse density |
void GasSolver::setImpulsePosition | ( | float | _posX, |
float | _posY, | ||
float | _posZ | ||
) | [inline] |
Sets the impulse position.
[in] | _posX | the X coordinate of the splat |
[in] | _posY | the Y coordinate of the splat |
[in] | _posZ | the Z coordinate of the splat |
void GasSolver::setImpulseTemperature | ( | float | _impulseTemperature | ) | [inline] |
Sets the impulse temperature.
[in] | _impulseTemperature | the new impulse temperature |
void GasSolver::setNoiseDrivingFunc | ( | int | _funcIndexX, |
int | _funcIndexY, | ||
int | _funcIndexZ | ||
) |
Sets the periodic noise driving function.
[in] | _funcIndexX | the index of the driving function in X |
[in] | _funcIndexY | the index of the driving function in Y |
[in] | _funcIndexZ | the index of the driving function in Z |
void GasSolver::setNoiseVariance | ( | float | _noiseVarianceX, |
float | _noiseVarianceY, | ||
float | _noiseVarianceZ | ||
) | [inline] |
Sets the periodic noise variance.
[in] | _noiseVarianceX | the turbulance variance in X |
[in] | _noiseVarianceY | the turbulance variance in Y |
[in] | _noiseVarianceZ | the turbulance variance in Z |
void GasSolver::setPoissonIterations | ( | int | _numPoissonIterations | ) | [inline] |
Sets the number of iterations of the Poisson solver.
[in] | _numPoissonIterations | the number of iterations |
void GasSolver::setSplatRadius | ( | float | _splatRadius | ) | [inline] |
Sets the splat radius.
[in] | _splatRadius | the new splat radius |
void GasSolver::setTemperatureDissipation | ( | float | _temperatureDissipation | ) | [inline] |
Sets the temperature dissipation factor.
[in] | _temperatureDissipation | the new temperature dissipation |
void GasSolver::setTimestep | ( | float | _timestep | ) | [inline] |
Sets the time-step.
[in] | _timestep | the new time-step |
void GasSolver::setVelocityDissipation | ( | float | _velocityDissipation | ) | [inline] |
Sets the velocity dissipation factor.
[in] | _velocityDissipation | the new velocity dissipation |
void GasSolver::togglePeriodicNoise | ( | bool | _enablePeriodicNoise | ) | [inline] |
Toggles the periodic noise function.
[in] | _enablePeriodicNoise | the periodic noise toggling flag |