You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, April 7th 2015, 4:51pm

WARNING: Too many active WebGL contexts. Oldest context will be lost.

Hallo Zusammen,

ich verwende den krpano HTML5 Viewer in einer AngularJS Anwendnung. Das klappt soweit ganz gut, nur wird in der Console ab und zu die Meldung ausgegeben:

Source code

1
WARNING: Too many active WebGL contexts. Oldest context will be lost.


Im FrontEnd scheint aber alles ganz normal zu laufen.

Ich rufe die Methode "embedpano" in einem view Controller auf, etwa so auf:

Source code

1
2
3
4
5
6
angular.module('app')
	.controller('MyCtrl', function ($scope) {
		$scope.$on('ngRepeatFinished', function () {
			embedpano({xml: "config.xml", target: "panorama", html5: "only", passQueryParameters: true});
	};
});


Die Meldung tritt auf, wenn ich den view einige Male hintereinander aufrufe. Scheint mir als würde da was nicht korrekt gelöscht/reinitialisiert.

Hat jemand von euch eine Idee? WebGL ist noch Neuland für mich ...

Vielen Dank im Voraus!

VG
Jan

2

Monday, April 13th 2015, 3:15pm

Hi,

der krpano Viewer muss per Aufruf explizit entfernt werden - siehe hier:
http://krpano.com/docu/html/#removing

Ansonsten werden Ressourcen (wie z.B. der WebGL Context) und diverse Events nicht freigegeben bzw. entferent.

Schöne Grüße,
Klaus

3

Tuesday, April 28th 2015, 12:02pm

Vielen Dank Klaus!
Das hat mein Problem gelöst ;)

Viele Grüße
Jan

4

Monday, September 21st 2015, 2:23pm

Same problem even with removepano()...

Hi,

I have the same problem in a one page web app ( AngularJS ).
We use embedpano in several "pages" in our web app.

Removing pano with removepano() at page change seems to not remove event listeners from krpano instance at removing time.
The problem arises after 10 to 20 embed / remove of panos. The message : WARNING: Too many active WebGL contexts. Oldest context will be lost. appears ( tested in Chrome / Safari OSX ).
The effect in Safari Iphone / Ipad makes webapp crash.

In krpano's function removepano() there is no removeEventListener at all. Only Dom elements removal ( seen on debugging with Developper Tools on Chrome )

With one page web applications, every event listener has to be removed ( resize events, scroll events, custom events, etc) before DOM elements are removed, in order to allow garbage collector to free memory.

Here are some tips on debugging WebGL contexts : https://www.khronos.org/webgl/wiki/Debugging
Maybe Kaus could tell us what "id" has the Krpano Webgl context once pano is embeded ? I could go further on debugging. Thanks.

Do you have any solutions ?

Thank you !
Regards.

This post has been edited 1 times, last edit by "cmel" (Sep 21st 2015, 2:55pm)


5

Friday, October 16th 2015, 9:39am

I have the same issue too

After a few times of removing and embedding krpano. I get the same error message "WARNING: Too many active WebGL contexts. Oldest context will be lost."
I'm using Angular too. But I don't think it has anything to do with Angular.

here's some code:


Source code

1
2
3
$scope.$on('$destroy', function() { 
removepano("krpanoSWFObject"); 
});


Source code

1
2
3
4
5
6
7
8
9
10
11
12
//region - - - - - - - - - - - - - - - - - - - - - - - - - - - - - embedPano 
function embedPano(scene){ 
pano = document.documentElement.querySelector('#pano'); 

removepano("krpanoSWFObject"); 
embedpano({swf:"/uploads/vtour/tour.swf", xml:"/uploads/vtour/tour.xml", target:"pano", html5:"prefer", id:"krpanoSWFObject"}); 

setTimeout(function(){ 
krpano().call("loadscene('" + scene + "', null, MERGE, BLEND(0.5));"); 
}, 400); 
} 
//endregion

6

Wednesday, October 21st 2015, 7:34pm

Same issue where chromium is complaining about too many webgl contexts

Same issue where chromium is complaining about too many webgl contexts


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.

7

Friday, October 23rd 2015, 6:11am

Hi,

just a quick note - this should be improved with the next krpano release.

Best regards,
Klaus

8

Friday, October 30th 2015, 11:07am

Interested in testing 1.19-PRE4

Hi Klaus,
I'm interested in testing the 1.19-PRE4 version. We have a project in standby mode because of these WebGL issue.
Thank you

image360

Intermediate

Posts: 204

Location: Austin, TX and Chicago, IL

Occupation: Photographer

  • Send private message

9

Thursday, December 17th 2015, 4:56pm

Issue in older production releases

Is this an issue in 1.18?

10

Monday, March 7th 2016, 10:34am

Tips on removing Webgl context

Hi,

There seems to be a solution in removing WebGL context through

Source code

1
gl.getExtension('WEBGL_lose_context').loseContext();


Idea comes from three.js library. Discussion with code examples available in a pixi.js github issue :
Source : https://github.com/pixijs/pixi.js/issues…mment-181650433

perspixe

Trainee

Posts: 64

Location: Bologna, Italia, Vancouver, BC

  • Send private message

11

Friday, October 28th 2016, 12:02pm

Any news?

I am having this problem also.
Embedding and removing panos quite a few times...

Any news on the removal of WBGL context also when removing panos?

12

Tuesday, December 6th 2016, 3:57am

I have same issues. When i display multiple krpano in single page, it appeared warning log `WARNING: Too many active WebGL contexts. Oldest context will be lost.` in javascript console. And some krpano can't be shown exactly. Please help me.

13

Friday, May 19th 2017, 8:15pm

Hi
Having exactly the same problem as princebk: ... multiple (8) panos on one page. They are small: only 300-400 in width and 159 height.
Although they are small and i generated an extra low res pano-version for this kind of animated 'preview', raising the amount of embedded panos from 4 (works) to 8 leads to black boxes for some panos.

Any help out there?

EDIT: Solved (with help from Klaus):
The limit of live WebGL-contextes we cannot control or change. It depends on browserversions and other systemspecific parameters.
But in my case - displaying only small animated panos as eyecatcher (8 at the same time) it helped
to control the rendering via HTML5="only+css3d". So no WebGL used for this small panos and it looks fine anyway!
Thx to Klaus!
best regards from www.PanAustria.com

This post has been edited 1 times, last edit by "PanAustria" (May 23rd 2017, 11:10am)