Framework 1: Creating a Skybox
As of right now, we have been using the regular skybox with the blue backdrop. It is fine on it’s own, but since we want to customized it to suit our game design, it is time to create our own. There are several ways in which we can create a skybox and in this article we will go through all 3 of them.
The first method is the most simple and it doesn’t involve using custom textures. The Procedural Skybox basically takes the same style as the original but with some added customization such as color. To start, create a new material, and in the inspector > Shader select Skybox > Procedural.
Once you have that set, we will see that you will have several options to work with. The Sun and Sun Size will add an artificial sun and adjust the sun size on the skybox.
Atmosphere Thickness adjusts the horizon color and simulates the time of day. Even thought there is limited settings there will be enough to customize the skybox to your liking.
As the name suggest, the Panoramic Skybox uses an image/texture which then wraps the image in a sphere. This is great if you have an image which you want to use.
To create a Panoramic Skybox, again create a new material and under Shader>Skybox > Panoramic. Import an image which you like to use and make sure the image is set to clamp for the wrap setting. Drag the image into the Spherical slot.
In the Panoramic settings there is also several settings that can adjust the skybox properties. Exposure adjusts the intensity of the brightness, while rotation is the ability to rotate the image.
Mapping is what changes the spherical shape to a cube with edges. If you image allows the perfect edge to edge match, then the “6 sided” settings might fit you better. Otherwise “Latitude Longitude Layout” would suit most situations.
The final skybox method is called the “CubeMap” which basically maps the entire backdrop in a a 6 sided cube. This settings is the best if you want the less amount of distortion in the skybox (which the Panoramic Skybox has a lot of). Unfortunately this custom skybox requires the most work in having all edge match, otherwise there will be an ugly cut which doesn’t align properly.
To set up the cubemap, you will need to have the image divided as such before you can import the image into Unity.
Create a new material and this time select 6 sided skybox. You will be greeted with 6 slots which are asking for a texture. This is where you can drag and drop the import image, you will see the skybox slowly form as the slots are filled.
To finally import the newly created Skybox into the scene, we can have two methods. The first one is to just drag and drop the Skybox material into the scene. The second method is under the Lighting Setting > Environment tab. Under the Skybox Material, either drag and drop the material or click the circle icon and select the material.