Space Sim
Loading...
Searching...
No Matches
Water

All water related rendering and FFT generation. More...

Files

file  src/FFT/bit_reversal.comp
 Reverses the bits before performing the FFT.
file  src/FFT/fft.comp
 Performs an FFT on the water grid.
file  src/FFT/water.comp
 The setup that interpolates the water grid via time before performing the FFT.
file  src/render/water.frag
 The shader that handles water shading and effects.
file  src/render/water.vert
 The shader that handles water vertex interpolation and normal sampling.

Functions

void init_water_grid (int N, int L, float A)
 Initializes the water grid at the start of the simulation with a wind direction.
void fft_textures (GLuint pi, GLuint po)
 Performs a bit reversal and FFTs the water group.
void update_water_fft (float t)
 Updates the water grid and FFTs it once per frame.
GLuint WATER_FFT_PING_TEXTURE
GLuint WATER_FFT_PONG_TEXTURE
GLuint WATER_FFT_PING_TEXTURE_2
GLuint WATER_FFT_PONG_TEXTURE_2

Detailed Description

All water related rendering and FFT generation.

Function Documentation

◆ init_water_grid()

void init_water_grid ( int N,
int L,
float A )

Initializes the water grid at the start of the simulation with a wind direction.

Definition at line 196 of file init.c.

References init_water_grid(), L, N, phi, rand_normal(), vec2_dot(), vec4::w, WATER_DATA, WaterData::water_data, water_fft_arr, vec2::x, vec4::x, vec2::y, vec4::y, and vec4::z.

Referenced by init(), and init_water_grid().

◆ fft_textures()

void fft_textures ( GLuint pi,
GLuint po )

Performs a bit reversal and FFTs the water group.

Output is in po.

Definition at line 274 of file init.c.

References BIT_REVERSAL_COMPUTE_SHADER, fft_textures(), stage, temp, WATER_FFT_COMPUTE_SHADER, and WATER_FFT_TEXTURE_SIZE.

Referenced by fft_textures(), and update_water_fft().

◆ update_water_fft()

void update_water_fft ( float t)

Updates the water grid and FFTs it once per frame.

See also
fft_textures()

Definition at line 322 of file init.c.

References fft_textures(), t, update_water_fft(), WATER_COMPUTE_SHADER, WATER_FFT_PING_TEXTURE, WATER_FFT_PING_TEXTURE_2, WATER_FFT_PONG_TEXTURE, WATER_FFT_PONG_TEXTURE_2, and WATER_FFT_TEXTURE_SIZE.

Referenced by main(), and update_water_fft().

Variable Documentation

◆ WATER_FFT_PING_TEXTURE

GLuint WATER_FFT_PING_TEXTURE

Definition at line 100 of file main.c.

Referenced by init(), and update_water_fft().

◆ WATER_FFT_PONG_TEXTURE

GLuint WATER_FFT_PONG_TEXTURE

Definition at line 101 of file main.c.

Referenced by init(), render(), and update_water_fft().

◆ WATER_FFT_PING_TEXTURE_2

GLuint WATER_FFT_PING_TEXTURE_2

Definition at line 102 of file main.c.

Referenced by init(), and update_water_fft().

◆ WATER_FFT_PONG_TEXTURE_2

GLuint WATER_FFT_PONG_TEXTURE_2

Definition at line 103 of file main.c.

Referenced by init(), render(), and update_water_fft().