Hi, I’m trying to use react-three-fiber to build a indoor configurator that takes params for each model’s url and transform info to layout the rooms. And since the models are random, I tried the following approaches to enhance performance.
Render side wise, I tried to:
- use on demand rendering
- disable shadowMap auto update, and only update mannually on model loaded/transformed
- Only use 1 ambientLight and 1 DirectionalLight for casting shadow
I didn’t use instancing since none model will repeat themselves.
And I didn’t merge geometry of the meshes during runtime since I have heavy interaction for each model
On model side, I tried to use gltf-transform to:
- resize texture
- do ktx2 for texture
- simplify geometries
- join meshes
- use custom texture atlas to merge textures
Yet, with all these approaches, for a scene with 164 models loaded, the fps is really low(below 20, sometimes even below 10). I wonder how I can further enhance the performance.
Here is the render info from three’s devtool
I know the drawcalls count is terrible, yet currently I failed to reduce it since I cannot do instancing, and I failed to merge the meshes in each model. I’ve considered do mesh merge during runtime, yet I succeed with mergegeometry, but failed with handling materials, also the need for interacting with each model and update their bvh makes it even harder.
And there is a clue from inspector.js’ capture, sorry I failed to upload the whole capture file since it is too large:
First, the overview of the scene.
And by going through the commands, I found there seems to be two phases.
It starts with canvas frame buffer, but then frame buffer: 7. The frame buffer: 7 phase seems to be rendering all the meshes in the scene in dark color.
Then it switches to canvas frame buffer to render all the meshes again, but in lighter color, and the result is used for final displaying.
I wonder what’s the frame buffer: 7 phase for, why it renders the whole scene in dark color. And since it is taking almost half of the commands, Is it possible to get rid of it to make the render faster.
I failed to see the reason of this issue and wish someone can shed light on how to enhance the performance of this random over 100 unique models render case.
Thank you so much.









