Cinematography in Unity — Skyboxes

Joshua Nielsen
3 min readDec 16, 2021

A good skybox is key to building atmosphere in a game

Photo by eberhard grossgasteiger from Pexels

We continue our study of cinematography in Unity by examining the subject of skyboxes. What do I mean by cinematography in Unity? By that I mean the intelligent use of Unity cameras and visual tricks to make the best looking games we can.

But what is a skybox exactly? A skybox is an illusion. A trick used in video games to make them appear larger than they are. When you see a skybox in a game, you might see what appears to be a city skyline, a distant mountain range, or a sky filled with clouds or stars. Are those distant visions actually in the game though? Probably not.

What you’re actually seeing are the boundaries of the level you’re in covered in textures that cleverly make them appear as distant spaces. Typically, this is accomplished by enclosing the entire space in a cuboid. The six sides of this cuboid have different textures projected upon them to reflect the different directions the player might look.

How to build a skybox in Unity

Building a skybox in Unity is actually very simple, provided you have the art assets ready. Start by creating a new material in your Unity project.

A new material in Unity

Once the material is created, the shader field must be changed from Standard to one of the Skybox options provided in the list. There are multiple options available, but for now just select 6 Sided.

Once you have that configured, you should see in the Inspector window six spaces for textures, each labelled for which direction they are meant to represent. If you have some assets ready, go ahead and put those into place on the material.

The material is configured to be a 6 sided skybox

So now we have the material ready to go, but how do we use it?

Setting the skybox in scene

In Unity, the skybox is actually configured under the lighting settings. If you don’t already have that open, go to the Window menu and you should find Lighting Settings in the Rendering section.

Unity Lighting Settings

Then, to actually set the skybox, find the Skybox Material setting and configure it to use your new skybox. Voila!

The new skybox in the scene

Other notes on the skybox

One more thing to note in this section is that your new skybox can have an effect on the overall scene lighting. Note in the picture above, many of the lighting settings are set to Skybox, which means the lighting in the scene is being influenced by the skybox itself.

If this is not what you’re going for in your scene, be sure to play around with the options to discover what will work for you.

Conclusion

After taking a Unity project from no skybox to a quality skybox, I think it becomes undeniable how much impact a game’s skybox can have on its overall mood and quality. Just the sort of thing we’re studying cinematography for!

Next time we’re really going to get in the thick of it and start working with the Cinemachine package. Until then, thanks for reading.

--

--