im trying to make three js render 4000 of these simple Boxes.
let mesh = new THREE.Mesh( new THREE.BoxGeometry(1, 1, 1), new THREE.MeshPhongMaterial({ color: THREE.MathUtils.randInt(0, 0xffffff), wireframe: false }) );
The problem is I get about 25 fps but my gpu usage is very low. I have a gtx 1070. I can get 120 fps at 1000 Boxes. The fps gets better when I look away from them.
Does anyone where the bottleneck could be? My chrome process cpu usage is also pretty low.
I suspect it has something to do with the internals of three js or even web gl itself.
Just for clarification: The performance of your application is bad since the number of draw calls is too high. There are several existing topics in this forum about draw call reduction e.g.:
Using instanced rendering e.g. via THREE.InstancedMesh is one possible approach to improve performance.