25#ifndef _Hydrax_Noise_FFT_H_
26#define _Hydrax_Noise_FFT_H_
40namespace Hydrax{
namespace Noise
105 const float& _PhysicalResolution,
107 const Ogre::Vector2& _WindDirection,
108 const float& _AnimationSpeed,
109 const float& _KwPower,
110 const float& _Amplitude)
135 const float& _PhysicalResolution,
137 const Ogre::Vector2& _WindDirection,
138 const float& _AnimationSpeed,
139 const float& _KwPower,
140 const float& _Amplitude,
141 const float &_GPU_Strength,
142 const Ogre::Vector3 &_GPU_LODParameters)
163 FFT(
const Options &Options);
186 void update(
const Ogre::Real &timeSinceLastFrame);
191 void saveCfg(Ogre::String &Data);
196 bool loadCfg(Ogre::ConfigFile &CfgFile);
203 float getValue(
const float &
x,
const float &
y);
243 const float _getPhillipsSpectrum(
const Ogre::Vector2& waveVector,
const Ogre::Vector2& wind,
const float& kwPower_ = 2.0f)
const;
Class to manager GPU normal maps.
std::complex< float > * initialWaves
the data which is referred as h0{x,t), that is, the data of the simulation at the time 0.
void _calculeNoise(const float &delta)
Calcule noise.
void _initNoise()
Initialize noise.
void setOptions(const Options &Options)
Set/Update fft noise options.
float * angularFrequencies
the angular frequencies
Options mOptions
Perlin noise options.
void _executeInverseFFT()
Execute inverse fast fourier transform.
void _normalizeFFTData(const float &scale)
Normalize fft data.
float * re
Pointers to resolution*resolution float size arrays.
const Options & getOptions() const
Get current FFT noise options.
const float _getPhillipsSpectrum(const Ogre::Vector2 &waveVector, const Ogre::Vector2 &wind, const float &kwPower_=2.0f) const
Get the Philipps Spectrum, used to create the amplitudes and phases.
FFT()
Default constructor.
bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
void saveCfg(Ogre::String &Data)
Save config.
const float _getGaussianRandomFloat() const
Get a Gaussian random number with mean 0 and standard deviation 1, using Box - muller transform.
int resolution
FFT resolution.
bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
GPUNormalMapManager * mGPUNormalMapManager
GPUNormalMapManager pointer.
void _updateGPUNormalMapResources()
Update gpu normal map resources.
float maximalValue
The minimal value of the result data of the fft transformation.
float getValue(const float &x, const float &y)
Get the especified x/y noise value.
std::complex< float > * currentWaves
the data of the simulation at time t, which is formed using the data at time 0 and the angular freque...
void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
Base noise class, Override it for create different ways of create water noise.
Struct wich contains fft noise module options.
Ogre::Vector3 GPU_LODParameters
LOD Parameters, in order to obtain a smooth normal map we need to decrease the detail level when the ...
float GPU_Strength
GPU Normal map generator parameters Only if GPU normal map generation is active.
float Amplitude
Noise amplitude.
int Resolution
Noise resolution (2^n)
Options(const int &_Resolution, const float &_PhysicalResolution, const float &_Scale, const Ogre::Vector2 &_WindDirection, const float &_AnimationSpeed, const float &_KwPower, const float &_Amplitude)
User constructor.
Ogre::Vector2 WindDirection
Wind direction.
Options()
Default constructor.
float AnimationSpeed
Animation speed.
float PhysicalResolution
Physical resolution.
Options(const int &_Resolution, const float &_PhysicalResolution, const float &_Scale, const Ogre::Vector2 &_WindDirection, const float &_AnimationSpeed, const float &_KwPower, const float &_Amplitude, const float &_GPU_Strength, const Ogre::Vector3 &_GPU_LODParameters)
User constructor.