howa
howa copied to clipboard
Improve performance
Greg helped benchmark the slides to identify where the performance is going down the drain:
"whenever you use the built-in geometry tools, it tends to have a nasty by-product of creating all of these small objects, webgl can't use JS objects, it uses ArrayBuffers of data.
So three.js maps geometry of faces and vertices -> buffers. For example, 1000 THREE.Vector3 -> Float32Array(3000)
So you're retaining all of these intermediate objects that aren't actually needed.
ideally there would be a TextBufferGeometry class that would cut out the points, as they aren't needed in the geometries
Although BufferGeometry has a fromGeometry method"