jdurrant Posted January 13, 2018 Share Posted January 13, 2018 I'm having an odd problem loading a texture on Firefox for Android. It seems to work on every other browser I've tested. Here's a url with an example of the problem: https://durrantlab.bio.pitt.edu/tmp/minimal_test_firefox_mobile_prob/ Here's the complete html code of that example: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Test</title> <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="manifest" href="./manifest.json"> <style> html, body, #renderCanvas { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { /* width: 100%; height: 100%; */ touch-action: none; } </style> </head> <body> <canvas id="renderCanvas" touch-action="none"></canvas> <script src="js/babylon.max.js"></script> <script> // Basic setup var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var scene = new BABYLON.Scene(engine); var camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 0, -10), scene); // Make a material var material = new BABYLON.StandardMaterial("mat", scene); material.diffuseColor = new BABYLON.Color3(0, 0, 0); material.specularColor = new BABYLON.Color3(0, 0, 0); material.diffuseTexture = null; material.emissiveTexture = new BABYLON.Texture("skybox.png", scene); // Make a box with that material var box = BABYLON.Mesh.CreateBox("box", 2, scene); box.rotation.x = -0.2; box.rotation.y = -0.4; box.material = material; // Resize the engine engine.resize(); // Start the render loop engine.runRenderLoop(() => { scene.render(); }); // Watch for browser/canvas resize events window.addEventListener("resize", () => { engie.resize(); }); </script> </body> </html> This is what it looks like in most browsers (in this case Chrome for Android): But here is Firefox for Android: Has anyone else encountered this problem? Any suggestions re. how to fix it? Thanks! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 14, 2018 Share Posted January 14, 2018 use exact path that can help something like this "https://durrant... /skybox.png" or "/skybox.png" Quote Link to comment Share on other sites More sharing options...
MarianG Posted January 14, 2018 Share Posted January 14, 2018 You have a console error, maybe this is the problem engie.resize() //should be engine.resize() Quote Link to comment Share on other sites More sharing options...
jdurrant Posted January 16, 2018 Author Share Posted January 16, 2018 Hi all. I fixed the "engie" error and changed to the full url: https://durrantlab.bio.pitt.edu/tmp/minimal_test_firefox_mobile_prob2/skybox.png The error persists in Firefox on Android, though. Here's an updated version of the code that still causes the same error: https://durrantlab.bio.pitt.edu/tmp/minimal_test_firefox_mobile_prob2/ Thanks, Jacob Quote Link to comment Share on other sites More sharing options...
MarianG Posted January 16, 2018 Share Posted January 16, 2018 On my Android 6 and firefox 57.0.4 it works Which is your specs? Quote Link to comment Share on other sites More sharing options...
jdurrant Posted January 17, 2018 Author Share Posted January 17, 2018 Very interesting that it did work for you, @MarianG . I'm on Android 7.0, LG G6, Firefox 57.0.4. Anyone else able to reproduce this problem? Thanks! Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted January 17, 2018 Share Posted January 17, 2018 Works here too on my phone. Have you try to reload your url in private browsing, just to be sure cache will be up-to-date ? Quote Link to comment Share on other sites More sharing options...
jdurrant Posted January 19, 2018 Author Share Posted January 19, 2018 Hi all. I reloaded in private browsing, but I still had the same problem. I asked some of my students to test it on their phones, and it worked fine for them. So strange that I can't reproduce this problem on anyone else's phone. Makes debugging very difficult! Thanks for your help just the same. All the best. 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.