Skip to content

Commit a64d376

Browse files
author
aardgoose
committed
adapt to storagetBufferAttribute
1 parent d71940f commit a64d376

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/webgpu_compute_particles_snow.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import WebGPU from 'three/addons/capabilities/WebGPU.js';
3232
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
33+
import StorageBufferAttribute from 'three/addons/renderers/common/StorageBufferAttribute.js';
3334

3435
import PostProcessing from 'three/addons/renderers/common/PostProcessing.js';
3536

@@ -102,7 +103,7 @@
102103

103104
//
104105

105-
const createBuffer = ( type = 'vec3' ) => storage( new THREE.InstancedBufferAttribute( new Float32Array( maxParticleCount * 4 ), 4 ), type, maxParticleCount );
106+
const createBuffer = ( type = 'vec3' ) => storage( new StorageBufferAttribute( Float32Array, type === 'vec4' ? 4 : 3, maxParticleCount ), type, maxParticleCount );
106107

107108
const positionBuffer = createBuffer();
108109
const scaleBuffer = createBuffer();

0 commit comments

Comments
 (0)