We are developing a real estate neighborhood using this game engine we procured, now as we add more and more assets into the scene, it feels like the performance gets slow, does three.js perform faster on LIVE and just normal on local. The game engine author mentioned it will be normally fast when uploaded live, because on our observation on the publish games using the cannon.js (trigger rally physics engine) in itch.io live sample1 and sample2, they perform really well.
They should perform roughly the same. If they don’t, something is probably jacked up in your setup.
If anything it should load faster on localhost, and load slower the first time when hosted elsewhere… but speed should be roughly the same, unless you’re using some kind of optimizing bundler.
its something about metis, it does not work on localhost, is there a way to trick the metis library on localhost? the combine assets on blender has now 4.3M triangles and we are now experiencing performance issues, we have just add few detailed structures with good resolution textures in pngs. this are proper 3d models from the architects.
4million is kinda high if it’s just one asset. What’s worse in your case are probably draw calls.
is 5.2M triangles a bad thing, we have the 3d model properly organized, each building, roads and other assets has its own hierarchy, now it starts to crash.
That’s pushing the limits. On a 4090 it’s probably usable.. on a lower end card/mobile.. probably not.
My rough guide is ~2million triangles max for consumer grade cards.
Another silent killer of performance is drawCalls.. which you can determine by reading the renderer.info structure after you call renderer.render. (or using some of the available performance monitor/fps widgets out there which package that data and show it to you on screen)
Draw calls should be kept low.. like in the low 100s ideally.
And if you do have a lot more than that.. try to disable matrix updates on things that don’t need it.
Regarding metis.. it may require https to support multithreading and that may be why it isn’t working on localhost.
If you’re using vite, you can try:
export default {
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
};
in your vite.config.js