#TreesJS master file no work on mobile.

25 messages · Page 1 of 1 (latest)

lament niche
#

I downloaded the treesJS master file, I uploaded them to my server, and I opened an example page, on my computer it works fine, on the mobile version it doesn't work, via the mobile console j I got this message : THREE.Webglrender: error creating webgl context

remote ingot
lament niche
#

On treeJS, ok my Bad, i no desactivate isolation mode on device

#

I went crazy trying to solve my previous problem, so I wanted to import locally, because I think that was the problem, but with this new attempt, I forgot to disable a parameter that disable webgl 😝

remote ingot
lament niche
#

I suspect ^^ but I also need the addons concerned too, otherwise it won't work well, right?

remote ingot
#

yes, but that unlikely justifies copying 350MB of entire master branch

#

either copy example files separately - depending on what you need (from example/jsm directory)

#

or just use npm i three - and you'll get the entire build + addons (without the 300MB)

lament niche
#

350 you're nice I exceeded 500 MB 😂

remote ingot
#

yup - considering the lib + addons are like 400kb, 500MB is a bit of an excessive overhead 🥲

lament niche
#

^^ NPM I don't know how to set it up, for now I use: <script type="importmap">{"imports": {"three": "https://threejs.org/ build/three.module.js","three/addons/": "https://threejs.org/examples/jsm/"}}</script> but apparently this has created problems on some mobile, and even if I use es-module-shims, so I thought that locally it would work better, but I admit I was a bit excessive 😂

#

When I say locally, I'm not talking about my computer, but having dl files on my server

remote ingot
#
  1. install node.js, you'll get npm automatically
  2. open vscode, in terminal there test npm -v to see if version shows up
  3. init npm project with npm init -y
  4. install three with npm install three
  5. when all previous steps succeed, spend 5 mins reading https://vitejs.dev/guide/ , install vite, and you're ready to go
#

vite + npm will make your coding significantly easier and faster - it's worth investing a second to read through that getting started

lament niche
#

Yes it may be a bit better than notepad++ 😂 Ok this is used to make the link with vscode, but if I'm on my web server, I have to do my import either via the site or a repository, or hosted on my web server, right?

remote ingot
#

wdym?

#

if you use vite + npm, you don't have to do anything, that's the point

#

it'll bundle and organise everything (incl. dependencies) for you

#

and give you a static website in return - which you can just put on your webserver, and that's it