In Unity, a skybox is a Material that uses a skybox Shader. For information on what skybox Shaders are available, see skybox Shaders.
|Feature||Built-in Render Pipeline||Universal Render Pipeline (URP)||High Definition Render Pipeline (HDRP)|
|Skyboxes||Yes (1)||Yes (1)||No (2)|
To create a new skybox Material:
Note: Each skybox Shader has its own set of prerequisite Textures that differ in number and Texture format. For information on the Textures a particular skybox Shader requires, see the documentation for that skybox Shader. You can find the list of skybox Shaders and their documentation on the skybox Shaders page.
After you create a skybox Material, you can render it in your Scene. To do this:
This draws the skybox in the background of every Camera in your Scene. If you instead only want to draw the skybox for a particular Camera, see Drawing a skybox for a particular Camera.
After you create a skybox Material, Unity can use it to generate ambient lighting in your Scene. To make Unity do this:
You can also specify when Unity updates the ambient lighting. To do this, change the Ambient Mode. The two values are:
For more information on environment lighting, see Outdoor lighting and Scene setup
If you only want to draw a skybox in the background of a particular Camera, use the Skybox component. When you attach this component to a GameObject with a Camera, it overrides the skybox that the Camera draws. To attach and set up the Skybox component:
If your Skybox includes a sun, moon, or other light in it, set up a Directional Light that points in the same direction as the light. This makes it appear as though the light in your skybox creates shadows in your Scene. If there are multiple Directional Lights in your Scene, you can choose which Directional Light the Skybox uses. To do this:
If you want to have fog in your Scene, match the fog color to the color of the skybox. This makes the fog blend to the color of the Scene sky. To do this: