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

Calculates vertex data. More...

Go to the source code of this file.

Functions

 layout (local_size_x=16, local_size_y=16) in
 Size of calculation kernels on GPU, preferably power of 2.
 layout (std430, binding=0) writeonly buffer Pos
 < Position of vertices to be written, y will be set to lower values if a WATER height is to be modeled and the WATER is under the surface.
 layout (rgba32f, binding=0) readonly uniform image2D textureOut
 Texture which can be used to read height in other shaders.
void main ()

Variables

uniform float scale
 height scale for terrain
uniform ivec2 size
 width height

Detailed Description

Calculates vertex data.

Output will be Vertice coordinates, texture coordinates and indices for rendering the height map as a model. The normals are created in another shader

See also:
normals.comp

Definition in file heightMap.comp.


Function Documentation

layout ( std430  ,
binding  = 0 
)

< Position of vertices to be written, y will be set to lower values if a WATER height is to be modeled and the WATER is under the surface.

< the terrheight which is used to create the model.

< indices to be written.

< Texcoords to be written

Definition at line 13 of file heightMap.comp.

void main ( void  )

< x,y global ID (i.e. which thread).

< x - clamped to working interval

< y - clamped to working interval

< x + 1 - clamped to working interval

< x - 1 - clamped to working interval

< y + 1 - clamped to working interval

< y - 1 - clamped to working interval

< writing offset for arrays

< Terrain height used when constructing water model

< The height of the current model

< Array offset

< The first vertex

< The second vertex

< The third vertex

< The fourth vertex

Definition at line 37 of file heightMap.comp.

 All Classes Files Functions Variables Enumerations