|
@@ -32,7 +32,7 @@
|
|
|
import WebGL from 'three/addons/capabilities/WebGL.js';
|
|
|
|
|
|
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
|
|
|
- import StorageBufferAttribute from 'three/addons/renderers/common/StorageBufferAttribute.js';
|
|
|
+ import StorageInstancedBufferAttribute from 'three/addons/renderers/common/StorageInstancedBufferAttribute.js';
|
|
|
|
|
|
let camera, scene, renderer;
|
|
|
let computeNode;
|
|
@@ -64,8 +64,8 @@
|
|
|
|
|
|
// create buffers
|
|
|
|
|
|
- const particleBuffer = new StorageBufferAttribute( particleNum, particleSize );
|
|
|
- const velocityBuffer = new StorageBufferAttribute( particleNum, particleSize );
|
|
|
+ const particleBuffer = new StorageInstancedBufferAttribute( particleNum, particleSize );
|
|
|
+ const velocityBuffer = new StorageInstancedBufferAttribute( particleNum, particleSize );
|
|
|
|
|
|
const particleBufferNode = storage( particleBuffer, 'vec2', particleNum );
|
|
|
const velocityBufferNode = storage( velocityBuffer, 'vec2', particleNum );
|