Sie sind nicht angemeldet.

1

Dienstag, 7. April 2015, 16:51

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:

Quellcode

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:

Quellcode

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

Montag, 13. April 2015, 15:15

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

Dienstag, 28. April 2015, 12:02

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

Viele Grüße
Jan

4

Montag, 21. September 2015, 14:23

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.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »cmel« (21. September 2015, 14:55)


5

Freitag, 16. Oktober 2015, 09:39

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:


Quellcode

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


Quellcode

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

Mittwoch, 21. Oktober 2015, 19:34

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

Freitag, 23. Oktober 2015, 06:11

Hi,

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

Best regards,
Klaus

8

Freitag, 30. Oktober 2015, 11:07

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

Fortgeschrittener

Beiträge: 215

Wohnort: Austin, TX and Chicago, IL

Beruf: Photographer

  • Nachricht senden

9

Donnerstag, 17. Dezember 2015, 16:56

Issue in older production releases

Is this an issue in 1.18?

10

Montag, 7. März 2016, 10:34

Tips on removing Webgl context

Hi,

There seems to be a solution in removing WebGL context through

Quellcode

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

Schüler

Beiträge: 64

Wohnort: Bologna, Italia, Vancouver, BC

  • Nachricht senden

11

Freitag, 28. Oktober 2016, 12:02

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

Dienstag, 6. Dezember 2016, 03:57

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

Freitag, 19. Mai 2017, 20:15

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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »PanAustria« (23. Mai 2017, 11:10)