jeremybyington Posted April 6, 2017 Share Posted April 6, 2017 I made a fallback for my Babylon scene in the event the user does not support webgl, and while I was developing the fallback I was just altering the logic to show the fallback slideshow instead of the canvas. When I was done developing it I disabled webgl in my Chrome browser and it looks like Babylon ran into a fatal error. I'm hoping this is just a bug that has something to do with Chrome, but I thought I would share it in case there might be something you guys can do about it. @Deltakosh I am going to continue testing in other browsers that don't natively have it. FYI, I used this plugin to disable it: https://chrome.google.com/webstore/detail/disable-webgl/nlapleiepodflfbclacdhmbldadobpah Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 6, 2017 Share Posted April 6, 2017 Unfortunately this is not something we can control. we are asking the browser for a gl context. If this context is broken we cannot detect it Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 6, 2017 Author Share Posted April 6, 2017 Thanks for your very quick response! I needed a fix ASAP so I came up with a not-so-elegant solution to test webgl support with Modernizr and then append a couple script elements to the body for hand.js and babylon.js ...and then a setInterval that waits until BABYLON is defined before executing the rest of the code.... I feel like I belong in JS prison for doing that, but... deadlines. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 6, 2017 Share Posted April 6, 2017 if (BABYLON.Engine.isSupported()) { var engine = new BABYLON.Engine(canvas, true, { stencil: true }); var scene = new BABYLON.Scene(engine); ... }else{ alert("WebGL not supported in this browser."); } Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 6, 2017 Author Share Posted April 6, 2017 Yes, the BABYLON.Engine.isSupported method is what I had been using, but the error occurs either before or during that when I disable webgl in Chrome and also in IE10. Now you have me second guessing and I have to take another look. Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 6, 2017 Author Share Posted April 6, 2017 Ok, so a quick test now with just that method and a console log has no errors, so there is something in my code that is the problem. Thanks for the help! Case closed. GameMonetize 1 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.