# Making background black when using createDefaultEnvironment

**URL:** <https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372>\
**Category:** Questions\
**Created:** [March 12, 2022, 6:32am UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372 "2022-03-12T06:32:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [March 12, 2022, 6:32am UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372/1 "2022-03-12T06:32:31Z")

</div>

when using  
scene.createDefaultEnvironment();  
the background is this blue tone. How can I make the background be black  
instead of that blue?  
thank you 🙂

---

<div class="post-metadata">

**Author:** ![kaliatech](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kaliatech/32/13557_2.png) [@kaliatech](https://forum.babylonjs.com/u/kaliatech)\
**Post date:** [March 12, 2022, 1:12pm UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372/2 "2022-03-12T13:12:18Z")

</div>

The createDefaultEnvironment helper takes optional [IEnvironmentHelperOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.ienvironmenthelperoptions). Setting skyboxColor likely gives you what you want. Example:

- [Babylon.js Playground - Skybox Color](https://playground.babylonjs.com/#HUDMGC)

More info:

- [Scene | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/scene/fastBuildWorld#create-default-environment)

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [March 12, 2022, 2:55pm UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372/3 "2022-03-12T14:55:56Z")

</div>

@kaliatech thank you, yes that works with this

var envHelperOpts:Partial = {  
enableGroundMirror: false,  
skyboxColor: new Color3(0.03, 0.03, 0.03),  
}

const env = scene.createDefaultEnvironment(envHelperOpts);

however when I tilt the scene downwards, I can see light below the texture with a bluish tone, where is that bluish tone coming from?

thank you

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [March 12, 2022, 3:00pm UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372/4 "2022-03-12T15:00:47Z")

</div>

@kaliatech actually and an extra problem, when I do this:

var envHelperOpts:Partial = {

enableGroundMirror: false,

skyboxColor: new Color3(0.005, 0.005, 0.005),

}

const env = scene.createDefaultEnvironment(envHelperOpts);

const xr = await scene.createDefaultXRExperienceAsync({

```
floorMeshes: [env.ground]

```

});

the background becomes black when I am not in inmersive mode, but when I click on the goggles and I go into inmersive mode then the background is that blue color again!

---

<div class="post-metadata">

**Author:** ![kaliatech](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kaliatech/32/13557_2.png) [@kaliatech](https://forum.babylonjs.com/u/kaliatech)\
**Post date:** [March 12, 2022, 3:07pm UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372/5 "2022-03-12T15:07:32Z")

</div>

That is the default ground color. To change:

- [https://playground.babylonjs.com/#HUDMGC#3](https://playground.babylonjs.com/#HUDMGC#3)

```javascript
    var envHelperOpts:Partial<BABYLON.IEnvironmentHelperOptions> = {
        skyboxColor: new BABYLON.Color3(0, 0, 0),
        groundColor: new BABYLON.Color3(0., 0, 0),
    }

```

Although if you don’t want any ground:

- [https://playground.babylonjs.com/#HUDMGC#2](https://playground.babylonjs.com/#HUDMGC#2)

```javascript
    var envHelperOpts:Partial<BABYLON.IEnvironmentHelperOptions> = {
        skyboxColor: new BABYLON.Color3(0, 0, 0),
        createGround: false
    }

```

Although if you don’t any ground or sky, then probably easier to not use the EnvironmentHelpers.

I don’t follow your last point about entering WebXR. It’s possible a camera position issue as when you enter XR your camera resets to your real world relative space. I would suggest you review the environment options, and then post Playground examples if you continue to have problems.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 11, 2022, 11:21am UTC](https://forum.babylonjs.com/t/making-background-black-when-using-createdefaultenvironment/28372/6 "2022-04-11T11:21:41Z")

</div>

Hello @javismiles just checking in, was your question answered?
