This feature requires the p5.webgpu.js addon.
이 API는 실험적입니다
향후 p5.js 버전에서 동작이 변경될 수 있습니다.
Creates a p5.StorageBuffer, which is a block of data that shaders can read from, and compute shaders can also write to. This is only available in WebGPU mode.
To read or write the data inside a shader, use uniformStorage(). To update its contents from JavaScript, call .update() on the result with new data.
Pass an array of objects to store a list of items, each with named properties. The properties can be numbers, arrays of numbers, vectors created with createVector(), or colors created with color(). Inside the shader, each item is accessed by index, and its properties are available by name.
You can also store a plain list of numbers by passing an array of numbers. Inside the shader, each number is accessed by index directly. To create an empty list to be filled in by a compute shader, pass a count instead.
예제
구문
createStorage(dataOrCount)