Waterflow
Visualize water in terrain
src/shaders/advectWaterShader.comp File Reference

Compute shader for advecting the water for shallow water implementations. More...

Go to the source code of this file.

Functions

float average (int i, int j)
 function for calculating averages of surrounding neighbours
float bilinjearInterpolation (float point_x, float point_y)
 function for calculating averages (by bilinearInterpolation) of surrounding neighbours
 layout (local_size_x=16, local_size_y=16) in
 This should be a nxn, where n is power of 2, however next step would result in 32x32, 1024 threads which is not always supported.
 layout (std430, binding=4) readonly buffer height0
 < height ping buffer
void main ()

Variables

uniform float dt
uniform ivec2 size
 width height

Detailed Description

Compute shader for advecting the water for shallow water implementations.

Definition in file advectWaterShader.comp.


Function Documentation

float average ( int  i,
int  j 
)

function for calculating averages of surrounding neighbours

Definition at line 58 of file advectWaterShader.comp.

float bilinjearInterpolation ( float  point_x,
float  point_y 
)

function for calculating averages (by bilinearInterpolation) of surrounding neighbours

Definition at line 78 of file advectWaterShader.comp.

layout ( std430  ,
binding  = 4 
)

< height ping buffer

< Terrain height

< VelocityY pong buffer

< VelocityY ping buffer

< VelocityX pong buffer

< VelocityX ping buffer

< height pong buffer

Definition at line 9 of file advectWaterShader.comp.


Variable Documentation

uniform float dt

simulation dt

Definition at line 54 of file advectWaterShader.comp.

 All Classes Files Functions Variables Enumerations