How to configure / use glb file and avoid bad performance?

I have a glb file that done for a project i’m working on - the file weight 19mb (17,000 polygons), after reducing the maps sizes… the file loads ok - but when i’m trying to select areas with raycaster - there is a huge delay.
After spending some time with This example - i noticed that the glb file - LeePerrySmith.glb weight only 405 kB …so my question is what is a “good” amount of polygons ? and perhaps there are any special setting that the 3d artist should do - to get better performances ? what is the best way to export glb from 3dsmax for this matter? Thanks,

17k polygons is totally fine for rendering if it’s basically the only main mesh in the scene as long as it’s not a lot separate geometries, in best case just one or a couple.

Raycasting though is getting slow at huge amount of triangles for 1 asset, but you can improve this a lot with a BVH as this nice repo of @gkjohnson does:

4 Likes

Thanks - i’m considering another solution - the glb file im using is a human body - divided by areas (hand, head, etc…) , so each time i select an area - i can apply raycaster on it - but since all the body parts remains in the scene - it’s performances are bad … when i hide all the other body parts - and load the scene - that the performance are good. i wonder if there is a way to “hide” the unselected objects by material or in any other way that they still remain on the scene?
This picture is to explain better what i ask - suppose the pink area is selected - is there a way that the not selected parts (the rest of the body) will change it’s geometry or material to be rendered as lower resolution ?

You don’t need to raycast against the entire scene, the raycast method where you pass the scene children array can be any array, you can also just use one specific object with raycaster.intersectObject.

Thanks - i know - that’s what i’m doing - applying raycasting only for the mesh i select - but while the other body parts appears - the raycasting is extremely slow… perhaps something with the pipeline of creating the glb is wrong? how come the my glb weights 19mb and most of the glb files in three.js examples do not weight more then 4-5mb like This Example
Maybe i need to reduce the glb size in some way…

Can you share an example, or a demo, or the model? There are many reasons a file could be large, it is hard to guess here sorry.