How to create a skybox like the one in the sandbox?

Hi!

I’m trying to create a nice looking background/skybox and I’d love to just have something like sandbox.babylonjs.com, but I’m having trouble figuring out how to do that.

I found this, but it’s not exactly what I’m looking for: Background Material | Babylon.js Documentation

I want to create something like that blurry skybox looking thing the sandbox has going on. I tried to dive into the code of it at: Babylon.js/packages/tools/sandbox/src/tools/environmentTools.ts at master · BabylonJS/Babylon.js · GitHub
But I can’t find the right file where that’s created and set. I can only find it setting environmentTexture, but I can’t get that to be a skybox.

I have found ways of setting a skybox by having a big cube with a material on it, but I don’t think that’s how it’s done in the sandbox, since it doesn’t seem to move when zoomin in or out.

Here’s a playground with just me setting the environmentTexture: Babylon.js Playground

Can someone point me in the right direction on how to do this? :smiley: Thanks!

You can use the createDefaultSkybox method:

4 Likes

Side note - this is where the environment is generated in the sandbox:

Babylon.js/packages/tools/sandbox/src/components/renderingZone.tsx at master · BabylonJS/Babylon.js (github.com)

1 Like

Haha, wow, no idea how I missed that. Thanks! :smiley: :dancer:

1 Like