How to make a cubemap skybox in Unity

A skybox in Unity is a material that draws a texture behind everything else in the scene. This guide covers both common sources, six face images and a single 360 panorama, and the import settings each one needs.

Updated

Cubemap or panorama: which one you have

Unity can import all three. The 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 that is twice as wide as it is tall, such as 4096 by 2048, is an equirectangular panorama. Unity calls this layout Latitude-Longitude.
  • One image in the shape of a cross or a strip of six squares is a cubemap that someone has already assembled.

From six faces

Unity imports a cubemap from a single image, so six separate faces have to be combined first. The generator below places them in the order Unity expects and lets you check the orientation in a 3D preview before you export.

  1. Drop the six face images into the cubemap generator. Files with suffixes such as _px, _left or _top go to the right slot on their own.
  2. Rotate the preview. If the horizon breaks at an edge, two faces are swapped or one is rotated.
  3. Export the Unity Sequence layout, a strip of six squares.
  4. Drag the exported image into your Unity project and 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 conversion tool. Unity converts it during import.

  1. Drag the panorama into your Unity project and 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, so 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, switch to the Environment tab, and assign the material as Skybox Material.
  5. Use the Rotation and Exposure sliders on the material to line up the sun and match the scene's brightness.

Common problems

  • Visible seams between faces. The six images do not match at their edges, or the texture is compressed 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 rotate 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 so Unity rebuilds the environment reflection.

Which skybox shader to use

  • Skybox/Cubemap takes one cubemap texture. Use it for the two workflows above.
  • Skybox/6 Sided takes six separate textures and needs no assembly. Set each texture's Wrap Mode to Clamp, or thin lines appear at the edges.
  • Skybox/Panoramic takes a panorama as a normal 2D texture and can 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 →