Yup, this is two bugs I want to share with you! The two of them are linked to https://wazana.io project
I noticed last week the game was not working anymore. As you can see in the console there is this new error showing up:
Uncaught TypeError: this._caps.parallelShaderCompile.maxShaderCompilerThreadsKHR is not a function
at n._initGLContext (engine.782c13b0.js:sourcemap:16)
at new n (engine.782c13b0.js:sourcemap:16)
at Object.exports.launchBabylon (engine.782c13b0.js:sourcemap:26)
at window.onload (engine.782c13b0.js:sourcemap:360)
It really came from nowhere and I canât really solve it by myself. The online page is using version 4.0.0-alpha.8 but I get the same result with stable version 4.0.3
So I decided to make an update of BabylonJS, but then I get this error message with last version 4.1.0-alpha.14:
scene.ts:3365 Uncaught TypeError: mesh.scaling.lengthSquared is not a function
at Scene._evaluateActiveMeshes (scene.ts:3365)
at Scene._renderForCamera (scene.ts:3524)
at Scene._processSubCameras (scene.ts:3622)
at Scene.render (scene.ts:3886)
at scene.ts:194
at Engine._renderLoop
I really want to find out which stuff I am using is the source of that error but errors happening in the render function can be hard to solve. For instance is there a way here to console the mesh which is creating the error? It doesnât work with try/catch.
the 4.0 issue comes from a change in Chrome regarding shader compilation. The spec evolved. So moving to 4.1 is a good idea
For your 4.1 bug, simply set a breaking at Scene._evaluateActiveMeshes (scene.ts:3365) or even better set your f12 debugger to break on all exception so the debugger will be triggered when the error will be hit
Thanks, the âbreak on all exceptionâ is very useful indeed!
I can confirm the mesh which triggers the error is a sphere which has been cloned. If I create an instance instead, I donât get the error but I need a clone in my case.
I canât reproduce the error in the playground but does that ring a bell?
We also get errors with the latest chrome. I couldnât reproduce it in PG yet.
babylon.js?v=1565697061647:formatted:5003 Uncaught TypeError: Cannot read property â0â of undefined
at e.getAttributeLocation (babylon.js?v=1565697061647:formatted:5003)
at e._bindVertexBuffersAttributes (babylon.js?v=1565697061647:formatted:8379)
at e.recordVertexArrayObject (babylon.js?v=1565697061647:formatted:8400)
at e._bind (babylon.js?v=1565697061647:formatted:24995)
at t._bind (babylon.js?v=1565697061647:formatted:11005)
at t.render (babylon.js?v=1565697061647:formatted:11156)
at t.render (babylon.js?v=1565697061647:formatted:24053)
at e.renderUnsorted (babylon.js?v=1565697061647:formatted:76510)
at e.render (babylon.js?v=1565697061647:formatted:76455)
at e.render (babylon.js?v=1565697061647:formatted:28732)
How can i disable webgl 2 support in playground?
I donât know if this is related but we disabled webgl2 in our app because we encountered some problems on some devices.
I also tried to enable wegl 2 today for our app to test it in the latest chrome. I didnât get an error but some of the materials were black. So its something related to materials/shader compilation.
I had this problem recently and it was due to the use of too big texture that did not load fast enough. The texture became black. When I resize the textures, it works.
I had this error too:
this._caps.parallelShaderCompile.maxShaderCompilerThreadsKHR
This is correct by updating to babylon 4.1
Here, Itâs random, sometimes the water is black and sometimes not, but I also have this random error in the console: (TypeError: Cannot read property â0â of undefined)
Links to the demos on babylon.com : Evasion : Evasion Survival: Survival V2
On the demo of Survival before, the camera was close to the character, now I load, she is very far away ???. (Itâs an arcRotateCamera.)
Yes but you are a developer, you know that it is almost impossible to fix an issue without a decent repro. I cannot spend a week digging into your code where it will be really easy for you to create simple one for me. You can easily isolate the meshes that have an issue and drop them either on the playground or at least on a page referencing babylon.max.js