Physical Based Rendering

HI RaananW can you show me what to type in to use the es6 packages

i have tried cloning the repo’s you and jelster provided and i have installed webpack but it still isnt working yet

Thx John

Hi John, sorry you’re having difficulty getting it to work the way you want.

When you say it’s not working, can you elaborate a bit on what or why? Once you’ve cloned or created your repo you’ll need to run npm install then something like npm run start to launch the dev server with webpack.

There’s very little more advice that we can provide without a bit more information, but if you want to see how to import and use various BJS components, the two repositories mentioned have many examples. Look at the top of a source JS file for the import statements.

HTH

2 Likes

Hi Jelster, ive updated my files in the github link below. I followed all the steps to install webpack and i have tried a couple of different ways to make sure i only use Babylon ES6 imports. I ended up copying the way the babylon es6 imports were done in the repo that you/RaananW sent me.

Sorry this is taking some time to solve.

Thanks John

It looks like the problem was just that you forgot to use the new keyword when creating the CubeTexture. Here it is working with that fix. I also commented out the imports and just used the CDN link for Babylon 4. OTOH if you want to switch to using the ES6 modules there’s more steps involved and I would recommend cloning a working example like above and starting with that. :slight_smile:

5 Likes

Hi Blake thank you soooooo much. It worked. Thanks also to everyone in this community who has helped me finally solve this. I really appreciate this Blake (i was just about to give up on it).

Thx John

3 Likes

Hi jgonzosan i finally got this to work using the link to your environment file and Blake’s code below. I havent been able to replicate it when creating my own env file. Ive tried creating the files with both the IBL tool and also by downloading IBLBaker and saving a dds file. I saved my files on github and tried to access them there as well as locally but no luck. I also downloaded your file locally but even the same file wouldnt work locally or on my git repo but it works every time when i use the link to your playground. I know you said you have had some intermittent issues with babylon recognising some files…can you let me know how you created the environment file in your playground or any other things that will help babylon recognise the file. thanks again John

Honestly, I’m not really sure why Babylon didn’t recognize the file at times. Sometimes I’d open the project up and it would say it wasn’t recognized and other times it would work fine.

One weird thing that seemed to fix the issue is that when I utilized the environment texture in a method that had a lot of other stuff being assigned/updated that’s when it would have an issue. When I started to separate stuff out into multiple methods it seemed to work fine.

I believe I only ever had this issue when using the file locally, so maybe something funky is happening where it doesn’t recognize the path, and/or the file gets changed somehow.

You could try updating to Babylon 5.0. I used it recently when I was trying to get Animation Events working as 4.2 didn’t seem to work with them. I have experienced stuff not working properly in 4.2 but work perfectly fine in 5.0, so it’s worth looking into.

1 Like

Thanks for this --i will give that a try thanks again for helping me out with this

1 Like

Hi everyone, im really close to being able to get this to work. I got this to work using the link to jgonzosan’s environment file on digital ocean and Blake’s code below. I havent been able to replicate it when creating my own env file. Ive tried creating the files with both the IBL tool and also by downloading IBLBaker and saving a dds file. I saved my files on github and google drive and tried to access them there as well as locally but no luck. I also downloaded jgonzosan’s env file locally but even the same file wouldnt work locally or on my git repo but it works every time when i use the link to jgonzosan’s playground. I didnt want to open a digital ocean account because it requires credit card payments. Ive also tried using the alpha version of babylonjs 5.0.

There must be a way to make this work recognising a local file. Can someone help me work out how to solve this thanks again everyone John

It looks like your server.js file is setup to only serve the index.html file. I added and served the folder named public and moved your index.html and sky.env files into it for example. Also here’s the relevant Express documentation for serving static files. :slight_smile:

2 Likes

Success. It works every time. Thanks for this Blake i really really appreciate it.

2 Likes