From 99fd016ddbd0964a7dbafa40ba9805e44713908c Mon Sep 17 00:00:00 2001 From: Avaer Kazmer Date: Sun, 1 Jul 2018 21:12:31 -0400 Subject: [PATCH] Add sharedbuffergeometry update ranges --- src/sharedbuffergeometry.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sharedbuffergeometry.js b/src/sharedbuffergeometry.js index de8184063..710ebd70b 100644 --- a/src/sharedbuffergeometry.js +++ b/src/sharedbuffergeometry.js @@ -80,9 +80,13 @@ SharedBufferGeometry.prototype = { geometry.setDrawRange(0, 0); geometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3).setDynamic(true)); + geometry.attributes.position.updateRange.count = 0; geometry.addAttribute('uv', new THREE.BufferAttribute(uvs, 2).setDynamic(true)); + geometry.attributes.uv.updateRange.count = 0; geometry.addAttribute('normal', new THREE.BufferAttribute(normals, 3).setDynamic(true)); + geometry.attributes.normal.updateRange.count = 0; geometry.addAttribute('color', new THREE.BufferAttribute(colors, 3).setDynamic(true)); + geometry.attributes.color.updateRange.count = 0; this.previous = null; @@ -147,9 +151,13 @@ SharedBufferGeometry.prototype = { update: function () { this.current.setDrawRange(0, this.idx.position); + this.current.attributes.color.updateRange.count = this.idx.position * 3; this.current.attributes.color.needsUpdate = true; + this.current.attributes.normal.updateRange.count = this.idx.position * 3; this.current.attributes.normal.needsUpdate = true; + this.current.attributes.position.updateRange.count = this.idx.position * 3; this.current.attributes.position.needsUpdate = true; + this.current.attributes.uv.updateRange.count = this.idx.position * 2; this.current.attributes.uv.needsUpdate = true; } };