index

This feature requires the p5.webgpu.js addon.
This API is experimental

Its behavior may change in a future version of p5.js.

Information about the current iteration of a compute shader.

Use it inside a buildComputeShader() function to write a loop that runs in parallel on the GPU.

index is a three-component vector with the current index across all dimensions passed to compute(). For example, use index.x to get the index when looping in one dimension.


Referencias Relacionadas