Have you tried the resource agent? It can solve your problem automatically. In simple terms, this is just an array filled with downloaded data, enriched with a good loading screen, here: https://github.com/BabylonJS/Babylon.js/wiki/Using-AssetsManager
<!DOCTYPE html> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Babylon.js sample code assetsManager loading</title> <script src="index_subory/hand.js"></script> <script src="index_subory/cannon.js"></script> <script src="index_subory/oimo.js"></script> <script src="index_subory/babylon.2.0.debug.js"></script> <script src="index_subory/jquery.min.js"></script> <style> html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { width: 100%; height: 100%; touch-action: none; } </style> </head> <body> <div style="background-color:grey;color:white;font-weight:bold;margin-left:auto;margin-right:auto;text-align:center;">Pre prehliadače s WebGL: WebGL Javascript pokus v babylon.js - ovládaj šípkami na klávesnici a ťahaním myškou:<br><div style="background-color:grey;color:white;font-weight:bold;">The Pulse [Ak nevidíte video, chyba je v prehliadači, ľutujeme, možno novší to zvládne ;-) ] </div></div> <canvas height="782" width="1440" id="renderCanvas"></canvas> <script> var canvass = $('#renderCanvas'); </script> </body></html>
This is my code used to preload the video with a nice downloadable post, then the scene is displayed.
source share