//A very simple case, get idx, get P according to idx, get the temporary variable pos by operation, and write pos into P
1 int idx = get_global_id(0); 2 if (idx >= P_length) 3 return; 4 float3 pos = vload3(idx, P); 5 pos.y += amplitude * sin( length(pos) / period + phase ); 6 vstore3(pos, idx, P);
rippling effect