21 #ifndef FFTWATER_HPP__
22 #define FFTWATER_HPP__
54 constexpr
static float G = 9.81f;
102 vec2 normalmap_freq_mod);
GLFFT::Buffer freq_height
void update_phase(float time)
GLFFT::Program prog_mipmap_height
GLFFT::Texture normalmap[2]
std::normal_distribution< float > normal_dist
unsigned displacement_downsample
GLFFT::Buffer freq_displacement
FFTWater(float amplitude, vec2 wind_velocity, uvec2 resolution, vec2 size, vec2 normalmap_freq_mod)
std::unique_ptr< GLFFT::FFT > fft_displacement
std::unique_ptr< GLFFT::FFT > fft_normal
void init_texture(GLFFT::Texture &tex, GLenum format, unsigned levels, unsigned width, unsigned height, GLenum mag_filter, GLenum min_filter)
GLint GLsizei GLsizei height
GLuint get_normal() const
cfloat phillips(vec2 k, float max_l)
std::unique_ptr< GLFFT::FFT > fft_height
GLint GLsizei GLsizei GLenum format
GLFFT::Texture displacementmap[2]
GLFFT::Texture heightmap[2]
void downsample_distribution(cfloat *out, const cfloat *in, unsigned rate_log2)
GLFFT::Program prog_mipmap_gradient_jacobian
std::vector< cfloat > distribution_normal
GLFFT::Program prog_generate_displacement
GLFFT::Buffer freq_normal
void generate_distribution(cfloat *distribution, vec2 size, float amplitude, float max_l)
unsigned get_displacement_downsample() const
GLFFT::Texture heightdisplacementmap[2]
GLFFT::Buffer distribution_buffer_displacement
GLFFT::Program prog_generate_normal
GLenum GLuint GLintptr GLsizeiptr size
GLFFT::Buffer distribution_buffer
GLFFT::Program prog_mipmap_normal
GLuint get_gradient_jacobian() const
GLenum GLuint GLint level
GLuint get_height_displacement() const
std::vector< cfloat > distribution
std::default_random_engine engine
void bake_height_gradient()
GLFFT::Buffer distribution_buffer_normal
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLFFT::Texture gradientjacobianmap[2]
void compute_mipmap(const GLFFT::Program &program, const GLFFT::Texture &texture, GLenum format, unsigned Nx, unsigned Nz, unsigned level)
GLFFT::Program prog_generate_height
std::complex< float > cfloat
std::vector< cfloat > distribution_displacement
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count
GLFFT::Program prog_bake_height_gradient