Houdini OpenCL Notes (1)

//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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325246067&siteId=291194637