Hi there,
Can I ask, to create larger amounts of particles more than like 100,000, which method is the best to do so in three.js? Three.Points or Three.InstancedMesh or Three.Mesh? Why?
Thanks.
Hi there,
Can I ask, to create larger amounts of particles more than like 100,000, which method is the best to do so in three.js? Three.Points or Three.InstancedMesh or Three.Mesh? Why?
Thanks.
Depends - what kind of particles / effect? Or just universal solution for any general effect?
2D particles â points or instanced triangles or postprocessing overlay
3D particles â instanced meshes or single buffer geometry with fancy noise shader
var pointsGeometry = new THREE.BufferGeometry();
pointsGeometry.setAttribute(ânormalâ, new THREE.BufferAttribute(new Float32Array(normals), 3, false));
pointsGeometry.setAttribute(âpositionâ, new THREE.BufferAttribute(new Float32Array(vertices), 3, false));
pointsGeometry.setAttribute(âcolorâ, new THREE.BufferAttribute(new Float32Array(colors), 3, false));
pointsGeometry.setAttribute(âsizesâ, new THREE.BufferAttribute(new Float32Array(sizes), 1, false));
I changed the functions above as follows. The program failed and the screen was even frozen with no error message.
THREE.BufferGeometry changed to InstancedBufferGeometry,
THREE.BufferAttribute changed to InstancedBufferAttribute
THREE.Points changed to THREE.Mesh or changed to THREE.InstancedMesh
var pointsGeometry = new THREE.BufferGeometry();
pointsGeometry.setAttribute(ânormalâ, new THREE.BufferAttribute(new Float32Array(normals), 3, false));
pointsGeometry.setAttribute(âpositionâ, new THREE.BufferAttribute(new Float32Array(vertices), 3, false));
pointsGeometry.setAttribute(âcolorâ, new THREE.BufferAttribute(new Float32Array(colors), 3, false));
pointsGeometry.setAttribute(âsizesâ, new THREE.BufferAttribute(new Float32Array(sizes), 1, false));
I changed the functions above as follows. The program failed and the screen was even frozen with no error message.
THREE.BufferGeometry changed to InstancedBufferGeometry,
THREE.BufferAttribute changed to InstancedBufferAttribute
THREE.Points changed to THREE.Mesh or changed to THREE.InstancedMesh
@S_Loan
What difficulty do you have with particles?
This example has 500k points and works well (have a look at its source code).
Thanks for your input. I used the same functions as the example you offered. It worked well. But, my question is when I tried replacing with other functions as follows and it did not work. Donât they easily replace with one another to create large amounts of particles? Iâm confused with the look-alike functions. Correct me, if iâm mistaken. Thanks.
THREE.BufferGeometry is changed to InstancedBufferGeometry,
THREE.BufferAttribute is changed to InstancedBufferAttribute
THREE.Points is changed to THREE.Mesh or changed to THREE.InstancedMesh