We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Firefox Error: WebGL context was lost

Home Forums WebGL & WebXR Troubleshooting Firefox Error: WebGL context was lost

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25289
    Alex TAYLOR
    Customer

    Hi – brand new member/purchaser here, so apologies if this is in the wrong place!
    As I’ve been working through first in trial mode and now licensed, I’ve identified that sometimes Firefox (and only Firefox) gets bogged down after multiple page reloads and navigation.
    I’m pretty sure that it is this known/acknowledged bug in Firefox:WebGL Context not being cleared after page reload.
    To summarise, after a number of WebGL contexts in an active tab, Firefox fails to clear them and eventually anything trying to use WebGL in this tab dies.
    While I am fairly sure that this is not a Verge3d problem, is it something that can be mitigated by changes to Verge3d, or should I try to design around it? (and hope Mozilla fix soon!)

    To summarise:

    • With my test model it happens after about 20 loads in the same tab
    • That sounds like a lot, however that holds even for navigating to many different pages with Verge3d instances (while remaining in the same tab)
    • Closing the tab and reopening does fix the problem, but I can’t expect users to do that
    • The development I’m working on would see users navigate in the same tab between different models, so this is likely to be an issue
    • Prior to discovering Verge3d (which is awesome!) I had been working with x3dom which also renders via WebGL but doesn’t seem to have this issue
    #25294

    Hi Alex,

    Thanks for becoming our customer.

    What may help here is cleaning up all the resources when the user reloads the page.
    Try this puzzle
    https://www.soft8soft.com/docs/manual/en/puzzles/Scenes.html#unload_scene
    coupled with onunload handler
    https://www.w3schools.com/jsref/event_onunload.asp
    See here about how you can mix Puzzles and JavaScript
    https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html

    Chief 3D Verger | LinkedIn | Twitter

    #25296
    Alex TAYLOR
    Customer

    Thanks for the quick and very helpful reply Yuri!
    I’ll work on those approaches next week, and report any progress back on this thread should it be useful to others.

    Thanks Alex

    #25300

    Sure, let us know how it goes.

    Chief 3D Verger | LinkedIn | Twitter

    #72399
    gezwoz
    Customer

    @yuri I have a similar problem with my application and need urgent help, since the app is now not loading reliably on iOS. The above instructions are not completely clear to me.
    How do I force a reset of the app when the user reloads the page? Using the unload scene puzzle somehow does not work for me, since that messes up everything. So what I am looking for is something that makes sure the scene is not kept in cache, at least that’s my understanding of why this might happen. I wonder though why this only happens on iOS.
    Even when it does work sometimes, I still see that content gets lost

    I tried the following. I installed Chrome browser on the iphone and started chrome://inspect
    then I open a new tab and load the app.
    It loads well, and I get:
    LOG Verge3D 4.5.1 for Blender (License, WebGL 2.0) so all seems good

    When I reload I sometimes get a correct scene, sometimes not, and this message:

    LOG Verge3D 4.5.1 for Blender (License, WebGL 2.0)
    LOG v3d.WegGLRenderer: Context Lost.
    LOG v3d.WegGLRenderer: Context Restored.

    I see part of the page, but the scene is not correctly loaded. Sometimes it just gets stuck on the preloader.

    EDIT: the above seems to happen only when I load the same page also in Safari. So it appears to me that there is an issue with Safari. If I close Safari down, the page loads correctly again.

    Thanks in advance for your help.

    The app is https://v3d.net/ukb

    Some more info: the app runs fine on ipad pro running iOS 16.5
    Also running fine on iphone pro max running 17.4.1

    I further see:
    https://forums.developer.apple.com/forums/thread/737042
    and:
    https://bugs.webkit.org/show_bug.cgi?id=268070

    how do I verify if the above is the case in my shaders?

    • This reply was modified 1 month ago by gezwoz.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.