Hey All,
I am working on a threejs project where I need to render multiple objects(glTF models) and also have a continuously moving camera.
renderer.info.memory
{geometries: 137, textures: 17}
Initially, there were around 5500-6500 draw calls happening and after tweaking the models a bit, I was able to bring it down to ~2000 draw calls. However, this did not seems to improve the FPS noticeably (still around 20 FPS).
As I was looking for a reason for this, I found this SO answer which talked about the fill rate. On trying this approach of debugging, I did find that “Fill Rate” was the one making the FPS reduce. My project was running at 55-60 FPS on smaller window size.
Also, it is very weird that just adding the below causes the FPS to reduce by ~10 frames. (With floor 20FPS and without floor - 30FPS)
var floorTexture = textureLoader.load( "/assets/models/textures/antiStaticFloor.jpg" );
floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping;
floorTexture.repeat.set( 1024, 1024 );
var floorMaterial = new THREE.MeshPhysicalMaterial({ color:0xe8f1ff, reflectivity:0, map: floorTexture })
var floorGeometry = new THREE.PlaneBufferGeometry( 500 , 500, 50, 50 );
var floor = new THREE.Mesh(floorGeometry,floorMaterial);
floor.rotation.x -= Math.PI/2;
floor.position.set(-125,0,-125);
floor.receiveShadow = true;
scene.add( floor );
I may be making a mistake somewhere or really bad with texture mapping in the above case but unable to find the reason.
Also, really appreciate any direction regarding the Fill Rate as I am unable to find a solution to handle it.
Does it have to be handled via custom shaders or is there a way to control them from threejs?
Best Regards,