Jump to content

Need help getting Babylon.js to work in Safari


Aerion
 Share

Recommended Posts

Hello all. I'm new here and may have found a bug in the Babylon.js / hand.minified-1.1.0.js frameworks. This bug only happens in safari, and in order for my 3D scene to display on Mac screens correctly, I need help to fix these few problems.

 

If you go to this link, this is the demo I am trying to get to run in Safari. If you click this link and open up the javascript debug console, you'll see what I mean when it returns a few errors within these 2 frameworks.

 

http://www.babylonjs.com/tutorials/blogs/customShaders/customShaders.html

 

If you try it in any other browser that supports WebGL, it will work fine. At least in the main browsers. Firefox, even IE is working. (IE9+). Google Chrome. Even Opera works.

 

Thank you for your help, and have a GREAT day! =)

 

Sincerely, 

 

Mythros

Link to comment
Share on other sites

Not on my Mac, Safari.  Version 6.16.  I have 3 versions of OSX on my system, but I prefer LION, even though it is old.

 

WebGL is only enabled by default on OS X 10.10 (the latest). You will not be able to get this to work on Safari "out of the box" on older versions. As gryff linked, there's instructions to enabling it on safari in older versions, but every user would need to do that.

 

Alternatively, Firefox and Chrome have WebGL support on all supported versions of OS X.

 

Keep in mind, this isn't a Babylon.js limitation, this is a Safari limitation. ;)

Link to comment
Share on other sites

Tower of Babel, if asked to create html does the example below.  If already enabled will never show, but if distributing, keep in mind the customer is not going to switch browsers for you.  Having a decent message of what to do is imperative.

<script>    if (BABYLON.Engine.isSupported()) {        var canvas = document.getElementById("renderCanvas");        var engine = new BABYLON.Engine(canvas, true);        console.log("Babylon version:  " + BABYLON.Engine.Version);        if (typeof(MORPH) !== "undefined") console.log("Morph version:  "   + MORPH.Mesh.Version);        var scene = new BABYLON.Scene(engine);        materialsRootDir = "./TOB-out"; // edit when texture files in a different dir than html        mesh_parent.initScene(scene, materialsRootDir);        scene.activeCamera.attachControl(canvas);                engine.runRenderLoop(function () {            animate(scene);            scene.render();        });    }else{        alert("WebGL not supported in this browser.\n\n" +               "If in Safari browser, check 'Show Develop menu in menu bar' on the Advanced tab of Preferences.  " +              "On the 'Develop' menu, check the 'Enable WebGL' menu item.");    }    //Resize    window.addEventListener("resize", function () {        engine.resize();    });    </script>
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...