I am not able to listen to “webglcontextrestored”. I have put alert and doesnot show up. Any clue?
webglcontextrestored is automatically triggered by the WebGL API and not by
three.js. Read the following documentation for more details:
three.js only restores it internal state after a context lost. But it might be necessary to execute additional logic on app level.
I am bit new to three.js. Can you please have a look at following fiddle see what am i missing? -
Have a look at this fiddle: https://jsfiddle.net/Lqr5w8es/1/
WebGLRenderer.forceContextLoss(), you also have to use
WebGLRenderer.forceContextRestore() in order to force the context restore.
But forceContextRestore doesn’t work when context lost happens organically in the browser rather than using forceContextLoss And in that case, even if I use forceContextRestore, it will not restore my state. Is that right?
If thats so, what should I do to restore in that case?
WebGLRenderer.forceContextRestore() are used to simulate a context loss and restore based on the WebGL extension
If you have a real context loss, the mentioned events should be triggered automatically. If this is not the case, I recommend you file a bug at the browser vendor’s issue tracker.