When I use the BABYLON.ParticleHelper and change the BABYLON.ParticleHelper.BaseAssetsUrl to use json files locally, it works for json files but not for images.
Even by creating our own json files with our own images, they will be search on this link: _rootUrl: "https://assets.babylonjs.com/particles/textures/"
instead of a local link
I don’t make a PG, because it will work, since the image search in the PG will point to the right link
What I do locally, I change the images of rain.json to make snow instead of rain.
And when I load locally the image is non-existent because the path points to Babylon’s assets.
I have prepared a beginning of PG, but I am missing the json file hosting that I do not have.
Locally I use EsayPHP. (I hope to take over a dedicated server in the year 2023)
I tried as @shaderbytes suggests to assign the textures after loading.
It worked like this, but we load a json file locally, the images entered in this json file should be local too, right?. Why should we load a ‘rain.json’ file for example and redefine the texture to something else.
When you load from the PG fire.json, it will look for the corresponding textures without having to redefine the images of the fires.
I don’t think redefining the textures like that is the real solution.
BABYLON.ParticleHelper.CreateAsync("rain", scene, false).then((set) => {
set.systems[0].particleTexture = new BABYLON.Texture("./textures/Snow.png", this.scene);
set.systems[1].particleTexture = new BABYLON.Texture("./textures/Snow.png", this.scene);
set.start();
});
I also tried with "http://127.0.0.1/RealmCraftingWebGL/_Projects/Demo/Data/Emitter_Configs" it returns the same thing: a link to https://assets.babylonjs.com/particles/
Whatever I do locally, it fetches the images from assets.babylon.com and not locally.
On the other hand if I redefine the images with new this.systems.particleTexture BABYLON.Texture("../linkLocal/img.png", this.scene); it works
So no, I don’t think it’s working. Your example works because the link points exactly where it should (assets.babylonjs)
I redefined with:
BABYLON.ParticleSystemSet.BaseAssetsUrl
The documentation misled me. maybe that should be clarified.
In fact, you have to do this for it to work.
BABYLON.ParticleHelper.BaseAssetsUrl = this.rootParticle; // For the json
BABYLON.ParticleSystemSet.BaseAssetsUrl = this.rootParticle; // For the textures