hybridius Posted May 5, 2015 Share Posted May 5, 2015 hey everyone, I've been around this forum a couple of times, and have usually found what I am looking for somewhere, but I'm a bit at a loss right now. I'm using Babylon.js to visualize architectural plans. The pre-babylon.js calculations have become sufficiently fast to load a number of scenes in quick succesion after another. My problem: This does not delete the webgl / babylon context. Anytime I load a new scene, the old one does not disappear (obvious from performance). I have come up with a number of ideas, but none have helped thus far.1) I have deleted and recreated the object responsible for anything babylon.js.This has had no effect. 2) There is only one active canvas at all times. Whenever a new scene is created, I delete the canvas, and do a parentNode.replaceChild with a new one.This has had no effect. 3) I have reset the old WebGL context to it's initial state (see https://www.khronos.org/webgl/wiki/Debugging), and created a new one. This has returned me a slew of errors WebGL: INVALID_OPERATION: uniformMatrix4fv: location is not from current program babylon.2.0.js:4WebGL: INVALID_OPERATION: uniformMatrix4fv: location is not from current program babylon.2.0.js:4WebGL: INVALID_OPERATION: uniform4f: location not for current program babylon.2.0.js:4WebGL: INVALID_OPERATION: drawElements: no valid shader program in use babylon.2.0.js:4 from babylon.js and breaks performance, showing me again that babylon.js tries to perform actions on the old context. As far as I am aware, I can not actively delete WebGL contexts - I have to wait for garbage collection to do that for me - but maybe I can disable any functions on that context or something the like? I would really appreciate help on the topic. As a side note, I'd appreciate tips on performance in general. hybridius Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 5, 2015 Share Posted May 5, 2015 Hello, Perhaps I did not get your question, but what about just calling scene.dispose() ? Quote Link to comment Share on other sites More sharing options...
Temechon Posted May 5, 2015 Share Posted May 5, 2015 scene.dispose();scene = null;Should do the trick. Do you create a new engine each time ? Do you have a running example somewhere to try to debug ? Quote Link to comment Share on other sites More sharing options...
hybridius Posted May 6, 2015 Author Share Posted May 6, 2015 hello, to think this was so easy... thanks a lot, you two 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.