THREE.js - Cannot load texture locally in Chrome Browser in Android device

三世轮回 提交于 2019-12-12 04:53:04

问题


I have been trying to load textures for a WebGL application in a Chrome browser in an Android device

I came across a similar post THREE.js - Can't load texture locally where a solution to load textures is given for Chrome which works only on a PC/laptop device

The flag --allow-file-access-from-files works on a laptop device as I can use the command line but how to do it on a mobile device?

Can someone please help with this?


回答1:


The Crosswalk projects embeds a Chromium webview and, by standard, will allow the loading of textures and models from files.You can compile your demo with Crosswalk by using this if you have a blacklisted gpu: make_apk.py --package=org.crosswalkproject.yourproject \ --manifest=your_webgl_demo/manifest.json --xwalk-command-line='--ignore-gpu-blacklist'

The last part isn't necessary if your gpu supports webgl completely. If you have problems though, replace the last part with --xwalk-command-line='--disable-web-security' which will give you total access to files (with all the risks involved).

But the simplest method is to use a webserver on android to access files from 127.0.0.1:8080. There are many free webservers on the playstore and I use them on a daily basis to test webgl demos on my device.



来源:https://stackoverflow.com/questions/26521338/three-js-cannot-load-texture-locally-in-chrome-browser-in-android-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!