# How to upload textures to Babylon playground?

**URL:** <https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161>\
**Category:** Questions\
**Tags:** particles\
**Created:** [January 4, 2021, 7:19pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161 "2021-01-04T19:19:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eco\_Editor](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@Eco\_Editor](https://forum.babylonjs.com/u/Eco_Editor)\
**Post date:** [January 4, 2021, 7:19pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/1 "2021-01-04T19:19:43Z")

</div>

Hello all,

I’m trying to create particle system within the Babylon playground.  
I’d like to upload a texture from my computer.  
Is it possible?  
I can see in this playground tutorial [https://playground.babylonjs.com/#0K3AQ2#3](https://playground.babylonjs.com/#0K3AQ2#3)  
That the particles has a texture, but the URL says: texture/flare.png  
see image specifically on that part:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/b/bc4470ff2e6fbcf019736cb9c9f4160d65a3ba70.png)

What does it mean? How did this texture “get” to his webpage? I mean, I tried loading from my machine by choosing “load texture from file”

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/9/9a3d339a9728a85a6afb444621711ea90d589a5e.png)

but I either couldn’t save it… where is the save button??  
or if I tried to rename it I get this:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/5/590e430c5db427f54710a55dc4a7759c1e4bf973.png)

I got this also when passing a texture location on my git:  
particleSystem.particleTexture = new BABYLON.Texture(“[https://github.com/](https://github.com/)…”, scene);  
So I read that I can’t pass a texture from a private repo.  
How do you add a texture? Are you creating a public repo / creating a new website for that?

oh… and I’m a complete noob in the web environment.

Thanks you for any help.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [January 4, 2021, 7:54pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/2 "2021-01-04T19:54:34Z")

</div>

You can reference texture from the outside as long as the server accepts CORS requests 🙂

/textures/ folder is here: [Babylon.js/Playground/textures at master · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/tree/master/Playground/textures)

---

<div class="post-metadata">

**Author:** ![Eco\_Editor](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@Eco\_Editor](https://forum.babylonjs.com/u/Eco_Editor)\
**Post date:** [January 4, 2021, 8:06pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/3 "2021-01-04T20:06:22Z")

</div>

> [@Deltakosh](#):
>
> CORS

How do I enable that?

---

<div class="post-metadata">

**Author:** ![Eco\_Editor](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@Eco\_Editor](https://forum.babylonjs.com/u/Eco_Editor)\
**Post date:** [January 4, 2021, 8:16pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/4 "2021-01-04T20:16:24Z")

</div>

Hi, I used a texture from the Pabylon.Js repo

```
particleSystem.particleTexture = new BABYLON.Texture("https://github.com/BabylonJS/Babylon.js/blob/master/Playground/textures/BJS-logo_v3.png", scene);

```

Would you say this line of code is supposed to work?  
I get the same red textures.

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [January 4, 2021, 8:29pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/5 "2021-01-04T20:29:37Z")

</div>

You need to use github raw link 🙂  
The primary github domain doesn’t allow cors

You should see an error in your browsers console / dev tools aswell

---

<div class="post-metadata">

**Author:** ![Eco\_Editor](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@Eco\_Editor](https://forum.babylonjs.com/u/Eco_Editor)\
**Post date:** [January 4, 2021, 8:33pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/6 "2021-01-04T20:33:50Z")

</div>

> [@aWeirdo](#):
>
> You should see an error in your browsers console / dev tools aswell

I saw a tutorial about CORS, and they suggested to use this line of code:  
fetch(“[http://localhost:8888](http://localhost:8888)”).then(a=\>a.text()).then(console.log)

These are the errors I get:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/e/e3d2ac5a56a097d379440b8d0b4f4179df821b39.png)

Where is the browser console when working with Babylon.Js on chrome? Is it in the dev tools?

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [January 4, 2021, 9:09pm UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/7 "2021-01-04T21:09:32Z")

</div>

Hey @Eco_Editor - This doc might help:

> **[Using External Assets In the Playground | Babylon.js Documentation](https://doc.babylonjs.com/toolsAndResources/tools/playground/externalPGAssets)**
>
> Learn how to use external assets in the playground in Babylon.js.

---

<div class="post-metadata">

**Author:** ![Eco\_Editor](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@Eco\_Editor](https://forum.babylonjs.com/u/Eco_Editor)\
**Post date:** [January 5, 2021, 9:27am UTC](https://forum.babylonjs.com/t/how-to-upload-textures-to-babylon-playground/17161/8 "2021-01-05T09:27:48Z")

</div>

Thanks @PirateJC that link did help
