satguru Posted April 9, 2016 Share Posted April 9, 2016 I sometimes see the following error in console. Error: WebGL: texImage2D: Uploading ArrayBuffers with FLIP_Y or PREMULTIPLY_ALPHA is slow. (babylon.2.4.max.js:3847:17) What does this mean? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 10, 2016 Share Posted April 10, 2016 Hello, it means that you should not use invertY in your texture because this could slow down the loading process (loading to the GPU memory) But this is not a big deal and it only impacts loading time and not rendering Quote Link to comment Share on other sites More sharing options...
satguru Posted April 10, 2016 Author Share Posted April 10, 2016 Not sure what invertY is but will checkup on that The scene file I use is exported from blender. I wonder if their is some setting there I could use. While we are on the topic of webgl error I also get the following error from time to time (usually on firefox) Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. Does not seem to have any effect but made me wonder what the issue was. Quote Link to comment Share on other sites More sharing options...
dbawel Posted April 11, 2016 Share Posted April 11, 2016 I assume you're using power of 2 textures, ( 64, 128, 256, 512, etc.) which are almost always more efficient to render. I believe that I received the same error which was corrected when I realized I was using an odd texture size and resized my image to power of two. But I can't be certain as it was eons ago. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2016 Share Posted April 11, 2016 Looks like your issue comes from too many canvases on the same page. Or comes from Firefox bug Quote Link to comment Share on other sites More sharing options...
phaselock Posted August 17, 2017 Share Posted August 17, 2017 Apologies for the thread necro, but I'm getting this error during dev as well in FFox: Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. I understand dispose() works, are there any procedures for GC on canvases/engines I should take note of ? A doc link would be nice here, I think. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 17, 2017 Share Posted August 17, 2017 This may be a ff bug as well where it does not dispose the context for some reason Are you using the latest bjs version (3.1 alpha?) Can you also check using memory snapshots that you do not have a leak that keep the context in memory (like a remaining event) Quote Link to comment Share on other sites More sharing options...
phaselock Posted August 21, 2017 Share Posted August 21, 2017 On 8/18/2017 at 0:27 AM, Deltakosh said: Are you using the latest bjs version (3.1 alpha?) Can you also check using memory snapshots that you do not have a leak that keep the context in memory (like a remaining event) I'm using 3.0. Memory is showing ~12MB when page loaded dropping to ~5MB after local server d/c (and I believe after GC). Primary calls in script are this.viewport.remove(); //canvas removal engine.dispose(); I don't think its sufficient. Heap snapshot shows that meshes in the scene are still retained, as well as the scene itself. I have to pore over this in detail. Is there a best practice doc/guide as to removing babylon created object references anywhere ? edit: I forgot, the GUI elements are also retained in memory, I'm seeing several getNodeText calls. Hope it helps. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 21, 2017 Share Posted August 21, 2017 Unfortunately, without a repro, I won't be able to help Quote Link to comment Share on other sites More sharing options...
phaselock Posted August 23, 2017 Share Posted August 23, 2017 On 8/22/2017 at 1:48 AM, Deltakosh said: Unfortunately, without a repro, I won't be able to help I took the PG codes from https://www.babylonjs-playground.com/#FBKE1P#1 and modified to add in a 30s timer (zip file) that disposes the scene and engine. You should be able to obtain the snapshot before timer runs out. Also, attached my ss fyr. Does this help ? index1.zip Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 23, 2017 Share Posted August 23, 2017 Unfortunately no, I need a simple page hosted somewhere where with a simple code you repro the issue. The idea is to concentrate only on the memory leak Quote Link to comment Share on other sites More sharing options...
phaselock Posted August 25, 2017 Share Posted August 25, 2017 Well, I managed to make it reproducible via window.location.reload(true) with the simplest of scenes (as below). A warning tho, this creates an infinite loading of the same page just to speed things up, so have F12 console viewable as the page reloads. I also tested multiple browser refresh in the basic scene of the PG and got the same result. Hope it helps. <script> window.addEventListener('DOMContentLoaded', function() { function createScene(engine,canvas) { var scene = new BABYLON.Scene(engine); //Adding an Arc Rotate Camera var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); return scene; } var canvas = document.getElementById('renderCanvas'); var engine = new BABYLON.Engine(canvas, true); var scene = createScene(engine,canvas); engine.runRenderLoop(function() { scene.render(); }); scene.dispose(); engine.dispose(); //canvas = null; canvas.remove; console.log("scene disposed? " + scene.isDisposed); window.location.reload(true); }); </script> Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2017 Share Posted August 25, 2017 Ok so as the leak remains even after a reload then this is clearly a browser issue ;( Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 25, 2017 Share Posted August 25, 2017 No, it is not a browser issue. It is a feature. This incarnation of this topic is a re-thread of this one. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2017 Share Posted August 25, 2017 Interesting "feature" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.