WebGL Context Lost issues (SOLVED)

  • Hello, I have an app that allows users to configure hotspots in a scene. This is basically what I'm doing using krpano.js in this tool.

    On the main page I load krpano using the embedpano function.

    Code
    krpanoJS.embedpano(
                                {target:"pano",
                                 html5:"auto",
                                 xml:"", 
                                 onready: onPanoStart, 
                                 vars:settings, 
                                 mobilescale:1.0, 
                                 passQueryParameters:true});

    When the user changes the scene to configure, I call removepano function just before embeding the view (need to do this for some backend validations)

    Code
    krpano.call("removepano('krpanoSWFObject');");

    but even doing this, I get the waring: Too many active WebGL contexts. Oldest context will be lost
    And occasionally I get the error: WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost and all the view goes black and I have to refresh the page in order to load the scene again.

    Does anyone had similar problem and know how to fix this?

    Thanks
    Best regards.

    Edited once, last by insideplaces: The issue was fixed by updating krpano.js. The file was somehow incomplete and missing removepano function. This was throwing removepano is not defined error, which was causing multiple WebGL contexts to be added to the stack. (May 9, 2019 at 8:40 PM).

  • Hi,

    removepano is a JS function and not an action - please see here:
    https://krpano.com/docu/html/#removing

    See here also an exampe for adding and remove krpano:
    https://krpano.com/examples/usage/#js-add-remove-panos

    Best regards,
    Klaus

    Hello Klaus, thank you for such quick response.

    But when I use removepano function I get js error: removepano is not defined. Comparing the mentioned example, the only difference is that in the example you load swf.

    Edit:
    When I inspect krpanoJS there is no function named removepano. Am I using a different version?

    https://pasteboard.co/IdU6UqQ.png

    Best regards

  • Hi,

    yes, your file is incomplete, normally the krpano.js files contains the embedding script (which contains the embedpano+removepano functions) and the html5 viewer.

    Just have a look into any default http://krpano.js/tour.js file or generate a new one using the tools or droplets.

    Best regards,
    Klaus

    Hi Klaus, I'll try generate new ones via update tool then.

    I'll let you know if this will fix.

    Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!