We use 100 invocations per work group, 10 in each dimension. The first statement in the compute shader defines the number of invocations per work group:
layout( local_size_x = 10, local_size_y = 10 ) in;
The uniform variables that follow define the constants in the force equations and the rest the lengths for each of the horizontal, vertical, and diagonal springs. The time step size is DeltaT. The position and velocity buffers are declared next. We define the position buffers at binding indexes 0 and 1, and the velocity buffers at indexes 2 and 3.
In the main function (step 4), we start by determining the number of particles in each dimension. This is going to be the same as the number of work groups times the work group ...