I have created a demo with numerous cubes that share the same geometry and texture:
texture = THREE.ImageUtils.loadTexture ...
material = new THREE.MeshLambertMaterial( map: texture )
geometry = new THREE.BoxGeometry( 1, 1, 1 )
cubes = []
for i in [0..1000]
cubes.push new THREE.Mesh geometry, material
... on each frame
for cube in cubes
// perform actions on each cube
After generating all the cubes, I begin moving them around the screen.
Although the cubes have identical textures and sizes, the computer struggles to render them all when there are hundreds of cubes.
Is there a way to inform Three.js / WebGL that these cubes are essentially the same object, just in different positions?
I've heard about BufferGeometry and Geometry2 potentially improving performance in this scenario, but I'm unsure of the best approach to take.
Thank you