How to make a cubemap skybox in Unity

To make a cubemap skybox in Unity, you need a cubemap texture and a skybox material. A skybox is a material that draws a picture behind everything else in the scene. This guide covers both common sources: six face images, or one 360 panorama. It also covers the import settings each one needs.

Updated

Cubemap or panorama: which one you have

Unity can import all three. The only difference is one dropdown in the import settings.

  • Six square images named right, left, up, down, front and back (or px, nx, py, ny, pz, nz) are the faces of a cubemap.
  • One image twice as wide as it is tall, such as 4096 by 2048, is a 360 panorama. Its full name is equirectangular. Unity calls this layout Latitude-Longitude.
  • One image shaped like a cross or a strip of six squares is a cubemap. Someone has already put it together.

From six faces

Unity imports a cubemap from one image, so you must join the six faces first. The generator below puts them in the order Unity wants. It also lets you check that each face points the right way in a 3D preview before you export.

  1. Drop the six face images into the cubemap generator. Files with endings such as _px, _left or _top go to the right slot on their own.
  2. Spin the preview. If the horizon breaks at an edge, two faces are swapped or one is turned.
  3. Export the Unity Sequence layout, a strip of six squares.
  4. Drag the exported image into your Unity project. Then select it.
  5. In the Inspector, set Texture Shape to Cube and Mapping to 6 Frames Layout. Then click Apply.

From a panorama

A 360 panorama needs no extra tool. Unity converts it when you import it.

  1. Drag the panorama into your Unity project. Then select it.
  2. Set Texture Shape to Cube.
  3. Set Mapping to Latitude-Longitude Layout.
  4. Raise Max Size to at least a quarter of the panorama's width. That way a 4096 pixel panorama keeps its detail on 1024 pixel faces. Click Apply.

Create the skybox material

  1. Right-click in the Project window and choose Create, Material.
  2. Set the material's shader to Skybox/Cubemap.
  3. Drag the imported cubemap onto the Cubemap slot.
  4. Open Window, Rendering, Lighting. Go to the Environment tab, and set the material as the Skybox Material.
  5. Use the Rotation and Exposure sliders on the material. Line up the sun and match the brightness of the scene.

Common problems

  • You can see seams between faces. The six images do not match at their edges, or the texture is squeezed too hard. Set Compression to High Quality and check the source images.
  • A face is upside down or mirrored. Swap it with another face in the generator, or turn the source image, and export again. The up and down faces are the usual cause.
  • The sky looks blurry. Max Size is too low. For six faces, set it to the width of one face. For a panorama, use a quarter of the width.
  • The sky is too dark or too bright. Change Exposure on the skybox material.
  • Objects do not reflect the new sky. Press Generate Lighting in the Lighting window. Unity then rebuilds the reflections from the sky.

Which skybox shader to use

  • Skybox/Cubemap takes one cubemap texture. Use it for both ways shown above.
  • Skybox/6 Sided takes six separate textures, so you do not need to join them. Set each texture's Wrap Mode to Clamp, or thin lines show at the edges.
  • Skybox/Panoramic takes a panorama as a normal 2D texture. It can also show 180 degree and stereo footage.
  • Skybox/Procedural draws a sky from sun, atmosphere and ground settings, with no texture.

Tools for this guide

All tools →

More guides

All guides →