Search the Community
Showing results for tags 'supported'.
-
Hello, I've tried a couple different event listeners, to no avail. In a "simple" (i.e. non-ASP.NET) page, it works just fine, engine starts, I can build a scene, no problem. However, when I embed my canvas in an ASP.NET MVC partial, then try and start the engine, I get "WebGL not supported". The script is in the body, renders along with the other partials to Html. Nothing special about that. window.addEventListener('DOMContentLoaded', function() { // get the canvas DOM element var canvas = $("#wizardCanvas"); // load the 3D engine var engine = new BABYLON.Engine(canvas, true); var createScene = function() { // create a basic BJS Scene object var s = new BABYLON.Scene(engine); // connect with partial-provided scene handler (buildScene || (function() {}))(s); return s; }; var scene = createScene(); // run the render loop engine.runRenderLoop(function() { scene.render(); }); // the canvas/window resize event handler window.onresize(function() { engine.resize(); }); }); I've also tried connecting with the onload event. No difference. window.onload(function() { // ... }); Here are my script references, via MVC script "bundles". <script src="/Scripts/jquery-1.10.2.js"></script> <script src="/Scripts/bootstrap.js"></script> <script src="/Scripts/respond.js"></script> <script src="/Scripts/jquery-ui-1.11.4.js"></script> <script src="/Scripts/ExtensionsJS/str-1.0.3.js"></script> <script src="/Scripts/ExtensionsJS/arr-1.0.1.js"></script> <script src="/Scripts/Oimo.js"></script> <script src="/Scripts/babylon.js"></script> <script src="/Scripts/poly2tri.js"></script> <script src="/Scripts/modernizr-2.6.2.js"></script> Is there something about the server-side MVC rendering that is causing problems? And how else would I know that, per se? Actually, I wonder if it is because my script references are in the incorrect order. I'll try that next. Regards, Michael Powell