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

Compute shader for advecting velocity for Y component. 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
 simulation time step
uniform ivec2 size
 width height

Detailed Description

Compute shader for advecting velocity for Y component.

Definition in file advectVelocityYShader.comp.


Function Documentation

float average ( int  i,
int  j 
)

function for calculating averages of surrounding neighbours

Definition at line 50 of file advectVelocityYShader.comp.

float bilinjearInterpolation ( float  point_x,
float  point_y 
)

function for calculating averages (by bilinearInterpolation) of surrounding neighbours

Definition at line 71 of file advectVelocityYShader.comp.

layout ( std430  ,
binding  = 4 
)

< height Ping buffer

< Terrain height

< VelocityY write buffer

< VelocityY read buffer

< VelocityX write buffer

< VelocityX read buffer

Definition at line 8 of file advectVelocityYShader.comp.

 All Classes Files Functions Variables Enumerations