Fun with Skyboxes in Unity

Simon Leen
3 min readJul 16, 2021

--

Objective: Implement a custom Skybox in Unity

There are some major differences when moving from 2D to 3D game development. One of those differences is the background. With 2D it can be just a simple color or image as the viewing perspective its from 1 angle. That changes drastically with 3D.

With 3D the viewing angle is everywhere, left, right, up, down, infront or behind you. Think about when a new game trailer comes out. Whether it’s a car game, war game or just a character on a boat or plane in the middle of nowhere, the visual aspect of the game can have a drastic effect on how the player feels. This is where skyboxes can come in.

Take the above 3D scene. We are not using a skybox here. Instead we have swapped to a solid color of black.

That wouldn’t make for a very interesting ride through a field on horseback or flying over a mountain range.

This is Unitys default Skybox. How much nicer is that for a background. Sun, blue sky fading into the horizon.

Unity also has plenty of other skybox packages in the asset store, some are even free.

I mentioned about horseback riding or flying a plane. The above skybox examples would make that gaming experience all the more enticing, allowing the player a more immersive experience.

Now getting back to our topic. To create and set up a custom skybox. We have been given a collection of 6 images to use for our scenes skybox. Start by creating a new material inside the projects materials folder and rename it to suit the project or scene (I will go with NY_skybox as the images were created to represent the New York skyline).

Click on the newly created material and inside the inspector, change from a standard shader to a 6-sided skybox.

Move each image into the correct skybox position. The skybox preview will show underneat so you can correctly identify that the images have matched up correctly.

Once finished, open the lighting settings using the window option in the top left and you will see a Skybox Material option in the Envoirnment section.

Depending on your Unity version and scene, a short cut is to drag the skybox into the scene.

We now have our custom skybox in the scene. In the next post, we will look at Light Probes in Unity.

--

--