# SkyBox alternative

**URL:** <https://forum.babylonjs.com/t/skybox-alternative/16313>\
**Category:** Questions\
**Created:** [December 4, 2020, 11:14am UTC](https://forum.babylonjs.com/t/skybox-alternative/16313 "2020-12-04T11:14:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [December 4, 2020, 11:14am UTC](https://forum.babylonjs.com/t/skybox-alternative/16313/1 "2020-12-04T11:14:56Z")

</div>

Hi, i’m developing a scene that can’t be served by a http server, so all the resources are locals and, for CORS policy, when i’ve to use external resources i embed them in code in base64. It works like a charm, but i’m not pretty satisfied with the background of my scene.  
The ideal thing would be to create a SkyBox but, if i’ve understood right, is only possible to give a path to the 6 imagese to load: i cant’ do that for CORS.  
My only possibility is to load a single base64 file embedded in code. Is there a way to do that? Instead of using 6 different file is it possible to use a single image file with correct UV mapping, or something like that?  
Thank you

---

<div class="post-metadata">

**Author:** ![atmin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/atmin/32/7756_2.png) [@atmin](https://forum.babylonjs.com/u/atmin)\
**Post date:** [December 4, 2020, 12:38pm UTC](https://forum.babylonjs.com/t/skybox-alternative/16313/2 "2020-12-04T12:38:55Z")

</div>

Check this example of base64-encoded environment texture, no external resources

[https://www.babylonjs-playground.com/#IH5G0H#11](https://www.babylonjs-playground.com/#IH5G0H#11)

Regarding single image file with UV mapping, [Creating A Box | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/mesh/creation/set/box) . Don’t forget to invert the normals (`sideOrientation`) if the camera is inside the cube.

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [December 4, 2020, 1:08pm UTC](https://forum.babylonjs.com/t/skybox-alternative/16313/3 "2020-12-04T13:08:44Z")

</div>

> [@atmin](#):
>
> Check this example of base64-encoded environment texture, no external resources
> 
> [https://www.babylonjs-playground.com/#IH5G0H#11](https://www.babylonjs-playground.com/#IH5G0H#11)

Yes, i’ve already tryed something like that, but the result is not so good (like the PG you linked, the background is not pretty well defined). SkyBox with 6 files seems to perform better.

I could try using UV mapping.

---

<div class="post-metadata">

**Author:** ![atmin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/atmin/32/7756_2.png) [@atmin](https://forum.babylonjs.com/u/atmin)\
**Post date:** [December 4, 2020, 1:20pm UTC](https://forum.babylonjs.com/t/skybox-alternative/16313/4 "2020-12-04T13:20:18Z")

</div>

> [@Mercurio](#):
>
> the background is not pretty well defined

Options:

1. user high-resolution texture, but file size will grow up considerably.
2. if low-resolution, but nice blurry background, instead of jagged artifacts is acceptable, you can give the SkyBox a PBRMaterial and experiment with material.microSurface. Code-only example, [https://github.com/atmin/pan0.net/blob/master/src/environment.ts](https://github.com/atmin/pan0.net/blob/master/src/environment.ts)
3. generate procedural texture, or use DynamicTexture and draw something on the canvas
