This feature requires the p5.webgpu.js addon.
이 API는 실험적입니다
향후 p5.js 버전에서 동작이 변경될 수 있습니다.
Declares a storage buffer uniform inside a modify() callback, making a createStorage() buffer accessible in the shader.
Pass a p5.StorageBuffer (or a function returning one) as the second argument to set it as the default value, applied automatically each frame. Pass a plain object with the same field layout as the buffer's struct elements to declare the schema without binding a specific buffer.
When called without a name, p5.strands automatically uses the name of the variable it is assigned to as the uniform name.
Note: uniformStorage is only available when using p5.strands.
예제
구문
uniformStorage(name, [bufferOrSchema])
uniformStorage([bufferOrSchema])
매개변수
name
String: The name of the storage buffer uniform in the shader.
bufferOrSchema
p5.StorageBuffer|Function|Object: A storage buffer to bind, a function returning a storage buffer (called each frame), or a plain object describing the struct field layout.
반환값
A strands node representing the storage buffer.
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/p5.strands.js and open a pull request!