]> git.tdb.fi Git - libs/gl.git/blob - demos/forestpond/data/fluidsim_fill.glsl
Remove the separate clamping step from forest pond fluid simulation
[libs/gl.git] / demos / forestpond / data / fluidsim_fill.glsl
1 import msp_interface;
2
3 #pragma MSP stage(compute)
4 layout(local_size_x=8, local_size_y=8) in;
5
6 uniform sampler2D bottom;
7 layout(r32f) uniform image2D surface_out;
8 layout(rg32f) uniform image2D velocity_out;
9
10 void main()
11 {
12         ivec2 coord = ivec2(gl_GlobalInvocationID.xy);
13         float surface = max(texelFetch(bottom, coord, 0).x, 0.0);
14         imageStore(surface_out, coord, vec4(surface, 0.0, 0.0, 0.0));
15         imageStore(velocity_out, coord, vec4(0.0));
16 }