Error: WebGL: Exceeded 16 live WebGL contexts

  • Hi, I'm trying to make a "pano preview" when mouse is over a hotspot.
    onover I display a textfield plugin with an iframe in it showing the linked pano.
    It works perfect, except after going over severals hotspots I have this error :

    Quote

    Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one


    So the main pano goes black !

    is there a way to avoid that ?

  • Hi,

    do you mean you load an iframe with the next pano on every onover?
    That's probably not the best solution? (in kind of performance and resources).

    About WebGL contexts error - that might be a browser bug - when the iframe will be removed then the resources from within the iframe page (like the WebGL context) should be removed too...

    The correct way for unloading/removing the krpano viewer from the webpage, would be called the removepano() function:
    https://krpano.com/docu/html/#removing

    But even then the WebGL context error might still happen when its a browser bug.

    Best regards,
    Klaus

  • Thanx Klaus for your reply,
    I tried with removepano() but the bug is still there on firefox (maybe it's a browser bug ?)

    do you mean you load an iframe with the next pano on every onover?
    That's probably not the best solution? (in kind of performance and resources).

    I load an iframe each time a hotspot has mouse onover (to display the linked panorama in a iframe before clicking to for loadpano())
    Here is my code :

    Code
    onover="txtadd(previewurl,'[iframe src=preview.html?image.cube.url=',get(name),'.tiles/mobile_%s.jpg width=100% height=auto frameborder=0][/iframe]');
    		         set(layer[preview].html,get(previewurl));
                             ...   "

    Is there a better way to to this ?

  • I am facing the same issue when switching two different panoramas in spite of clearing the previous one before loading the next one.
    I'm using chromium for my app. Every time I change the panorama, I'm removing the previous panorama with removepano('krpanoSWFObject'). I have doubled checked and found that even though remove pano removes the panorama from DOM, it probably isn't clearing event handlers and webgl context


    Typical observations I made about this issue include:
    1. The memory consumption increases gradually every time the panorama is changed
    2. After 8-10 times of changing the panorama, chrome starts showing the warning "Too many active WebGL contexts. Oldest context will be lost"
    3. I've tested with Firefox, Chrome and Chromium to find same results
    4. I tried removing the canvas element from DOM using jquery. But, I still didn't notice any difference in the behavior.

Participate now!

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