WebGPU to WebGL fallback and scene state preservation after Babylon.js engine initialization
24.5K reputation · 08 Jul 2020, 02:49 UTC
Engine initialization in Babylon.js requires explicit canvas creation and engine instantiation, with capability detection determining available rendering features such as WebGL2 and optional WebGPU. SceneLoader and AssetManager load assets asynchronously via promises and observables.
Disposal of meshes, materials and textures is manual by default, and scene.dispose does not automatically free all GPU resources unless explicit disposal options are enabled. Behavior is version sensitive around WebGPU support, engine.dispose semantics and automatic texture disposal options.
Capability detection is browser and device dependent and cannot be reliably inferred from server deployment logs alone. An unresolved decision concerns how the engine handles backend fallback and state preservation when a preferred rendering backend becomes unavailable after initialization.
Does Babylon.js preserve scene graph and GPU resource state when falling back from WebGPU to WebGL after engine creation? Which resources require explicit re-creation versus automatic re-binding on backend change? When is fallback supported versus requiring engine recreation?