My journey becoming a Unity game developer: Environment & Lighting-Skybox

Objective: Adding a Skybox to the environment in this scene.

Go to the Materials folder or Skybox folder if you will have multiple skyboxes, right-click on it and Create->Material and name it NY_Skybox. In the Inspector, drag the cubemap images to their respective slot according to the X, Y, and Z HDR axis. These images will form a 6-sided cube which will show the environment our scene will work within.

Creating a Skybox using cubemaps inside the material.

Go to the Lighting tab or open it by Window->Rendering->Lighting. Drag the NY_Skybox material to the Skybox Material slot.

NY_Skybox material inserted into the Skybox Material’s slot under Lighting.

Another way to create a skybox material is to use cubemaps set in a cross-like texture.

Free cross-like cubemap from CleanPNG/KissPNG.

Click on the cubemap, go to Texture Shape, change it from 2D to Cube, and scroll down to click on Apply. The texture will change from a 6-sided cubemap to a Sphere cubemap. You can rotate the sphere to see how the texture’s environment will look.

Cubemap changed from 2D to Cube.
Rotating the new cubemap texture to see the environment.

Create a new material name Skybox1. Over in the Shader, change it from Standard to Cubemap by selecting Skybox.

Created a new skybox material, and changed Shader to Cubemap.

In Lighting under Environment, drag the Sky1 material into the Skybox Material.

The new sky environment added.

Make sure the cubemap panels are the same pixel size because Unity will not allow it to work properly. You can try to fix the cubemap in a graphics editor, or better yet is to find another cubemap.

One last skybox is the Panoramic View. We’re using a HDR sky maps for a higher-resolution quality environment. The downloaded map file was placed in the Skybox folder. Create a new Material, change Shader to Panoramic and drag image into Spherical (HDR).

If you see something like this white seam as you’re scrolling around the environment, click on this image.

White seam coming down the screen.

Inside the Inspector, change Wrap Mode to Clamp, turn off Mip Maps, and click Apply. Clamp will bring all sides of the panels together to remove any seams. Mip Maps create a less intense image that will be seen in the distance. It makes images look blurrier the further away from the player’s camera.

HDR image wrap mode and mip maps setting changed to remove any seams in the image.

Drag the HDR material onto the Skybox Material in Environment under the Lighting tab.

Just remember if you see seams in your environment, click on the image used to make the material and use Clamp in Wrap Mode to make the environment’s image seamless.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store