I learned that with the meshopt algorithm, bjs has to load the plugin, so I added this code!!!
const engine = new Engine(canvas, antialias, engineOptons, adaptToDeviceRatio);
MeshoptCompression.Configuration = {
decoder: {
// default is the CDN path, I changed it and use my local files
url: "javascripts/meshopt_decoder.js" // the path of my local file
}
};
const scene = new Scene(engine, sceneOptions);
There don’t seem to be too many examples of meshopt, should I do this?
Or is there a better compression than meshopt to optimize the model on the mobile ?
This sounds like a WebView problem. I don’t have much experience with using WebView on iOS, but from a quick look at documentation, it really depends on how you loaded the page. For example, if call loadHTMLString, there is a baseURL parameter that determines where the local files are loaded from. If you call loadFileURL, there is an allowingReadAccessTo parameter. How are you loading your WebView?
Right, optimizing with meshopt requires the loader to load the meshopt extension which must load the meshopt library from separate js/wasm files. If you don’t optimize with meshopt or draco then you don’t need the separate files.
After testing and comparison, we found that the optimization result of meshopt is very good. Of course, I do not want to load additional plugins, because I think loading plugins on the mobile terminal will always affect the performance or loading speed. Is there any other better optimization scheme?
From your message I can’t seem to understand if it worked once you used the local file instead of the CDN. Does it work locally? (And sorry if I missed something!)
It depends on what you are doing with the model. A lot of times, simply doing quantization makes a big difference. Quantization does not require additional libraries. Meshopt or Draco will compress more but it may not give a huge difference.