I run quite a simple loop creating 30 new Cube meshes:
for(i=0; i<30; i++){
var zPos = 0 + i * (cubeHeight+ySpace) + cubeHeight/2;
cube = new THREE.Mesh(new THREE.CubeGeometry(cubeWidth, cubeWidth, cubeHeight), material);
cube.position.z = zPos;
cube.castShadow = true;
cube.recieveShadow = true;
parent.add(cube);
}
This runs terribly slow. What could the causes be?
(I assume I should be able to re-render 30 boxes continuously without performance issues?)