1 #pragma MSP stage(compute)
2 layout(local_size_x=8, local_size_y=8) in;
7 float velocity_damping;
9 float max_flow_fraction;
15 layout(push_constant) uniform Time
20 uniform sampler2D surface_in;
21 uniform sampler2D velocity_in;
22 uniform sampler2D bottom_in;
23 layout(r32f) uniform image2D surface_out;
24 layout(rg32f) uniform image2D velocity_out;
26 vec2 get_depth(ivec2 coord)
28 float surface = texelFetch(surface_in, coord, 0).x;
29 float bottom = texelFetch(bottom_in, coord, 0).x;
30 return vec2(surface, surface-bottom);
33 vec4 get_data(ivec2 coord)
35 vec2 velocity = texelFetch(velocity_in, coord, 0).xy;
36 return vec4(velocity, get_depth(coord));