When this happens, our WebGL apps will need to reallocate their textures, VBOs, shaders etc. on a new context afterwards.
In the demo below, I'm forcing xeoEngine to blow away the WebGL context every ten seconds to demonstrate SceneJS 3.0's automatic scene recovery (notice the glitch every ten seconds):
Check out this Pen!
Under the hood, SceneJS takes care of that recovery seamlessly without disruption to code at higher layers (eg. xeoEngine). When the loss occurs, SceneJS reallocates shaders and buffers from data it retains in its scene graph. xeoEngine just experiences a short delay, then it's back in business without reloading anything off the server or reinitialising app code.It's surprising how fast recovery can happen - in the BioDigital Human, SceneJS takes around 5-7 seconds to recover a scene containing approximately 2000 meshes and 100 textures.
It's not 100% robust yet, because it can fall over if scene modifications are made while recovering, but we're getting almost no errors relating to lost WebGL context in Human now.
No comments:
Post a Comment