You are not logged in.

1

Wednesday, May 8th 2019, 7:33pm

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.

Source code

1
2
3
4
5
6
7
8
        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)

Source code

1
     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.

This post has been edited 1 times, last edit by "insideplaces" (May 9th 2019, 8:40pm) with the following reason: 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.


2

Wednesday, May 8th 2019, 11:03pm

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

3

Thursday, May 9th 2019, 3:11pm

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

This post has been edited 2 times, last edit by "insideplaces" (May 9th 2019, 3:29pm)


4

Thursday, May 9th 2019, 3:49pm

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 krpano.js/tour.js file or generate a new one using the tools or droplets.

Best regards,
Klaus

5

Thursday, May 9th 2019, 3:52pm

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 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

6

Thursday, May 9th 2019, 8:37pm

Updating krpano.js fixed the problem.

Thank you.