From 139be25e20d8189d2ed83cf129229d08acf4b5ad Mon Sep 17 00:00:00 2001 From: Lee Stemkoski Date: Sat, 12 Mar 2022 13:40:44 -0500 Subject: [PATCH] updated to work with A-Frame 1.3.0 --- aframe-mesh-particles-component.js | 18 +++++++++--------- assets/banana/CHAHIN_BANANA_TEXTURE.jpg | Bin 726 -> 6789 bytes index.html | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/aframe-mesh-particles-component.js b/aframe-mesh-particles-component.js index a0d2d1d..f7f1d07 100644 --- a/aframe-mesh-particles-component.js +++ b/aframe-mesh-particles-component.js @@ -441,23 +441,23 @@ updateAttributes() { if (this.geometry) { const n = this.count - this.geometry.maxInstancedCount = n + this.geometry.instanceCount = n let instanceIDs = new Float32Array(n) for (let i = 0; i < n; i++) { instanceIDs[i] = i } - this.geometry.addAttribute("instanceID", new THREE.InstancedBufferAttribute(instanceIDs, 1)) // gl_InstanceID is not supported, so make our own id - this.geometry.addAttribute("instanceOffset", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) - this.geometry.addAttribute("instanceVelocity", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) - this.geometry.addAttribute("instanceAcceleration", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) - this.geometry.addAttribute("instanceAngularVelocity", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) - this.geometry.addAttribute("instanceAngularAcceleration", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) + this.geometry.setAttribute("instanceID", new THREE.InstancedBufferAttribute(instanceIDs, 1)) // gl_InstanceID is not supported, so make our own id + this.geometry.setAttribute("instanceOffset", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) + this.geometry.setAttribute("instanceVelocity", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) + this.geometry.setAttribute("instanceAcceleration", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) + this.geometry.setAttribute("instanceAngularVelocity", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) + this.geometry.setAttribute("instanceAngularAcceleration", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) if (this.relative === "world") { - this.geometry.addAttribute("instancePosition", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) - this.geometry.addAttribute("instanceQuaternion", new THREE.InstancedBufferAttribute(new Float32Array(4*n).fill(0), 4)) + this.geometry.setAttribute("instancePosition", new THREE.InstancedBufferAttribute(new Float32Array(3*n).fill(0), 3)) + this.geometry.setAttribute("instanceQuaternion", new THREE.InstancedBufferAttribute(new Float32Array(4*n).fill(0), 4)) } } }, diff --git a/assets/banana/CHAHIN_BANANA_TEXTURE.jpg b/assets/banana/CHAHIN_BANANA_TEXTURE.jpg index fe3245f91de29129283c317aa9fe737a3effa243..28b0db94c2927de3ff2a259961e2a82f649ec047 100644 GIT binary patch literal 6789 zcmeHMdvH@#8b3FWCTS8(+S^h}UDD7>%Jk-OlQxgF7TTsINS7vUc~oZb=H{jeHV=}N z7Dm^K0&ZAWt+lr7A3#_hmR(nNL1lM#0H3?)&R7rymth1IcO7>YM09o6&3@-5eV~Yn z&g>uClbpG~ob&sB_xrwcZs**u>67WVkZNJ0s}T{@d+9lgUAw9YzzdiER_UfGPHn$f#l|ViFdBM?zpIU|g8> zE(d<+Ou_|OjCq70qmu`GK^AY6zyvfY|4C2I7j_+(>A#?QB+bc@!J4{j_jDbbYa=V-K*vr9^J){07_$zrk0nq#lA(KqYO78;8XGMP*v zR}?9gMRaLNDgCWm`Y=*Uu}?xmiv(&ys3y|Sqgmjm7_Tk?&Sn}R5Q@Y(5~(a#4uk_L z1ep>FL_)DxBm(wbFporPabBrueonrdk!V+w^gR!6m(H%+ccj2GdZEnhjjfmE7EUjk zQCxo099_j+OI5YiW_Q##I2)T5xE8jywJ%w^Y1g`xigF^wH&yKl$gUpW(Q0oMY{(aj79Lfk-42NpM_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