확인 완료한 버전: 4.1
A skybox is a panoramic texture drawn behind all objects in the scene to represent the sky or any other vista at a great distance. This lesson explains how to use skyboxes in Unity.
A skybox is a panoramic view split into six textures representing six directions visible along the main axes (up, down, left, right, forward and backward). If the skybox is correctly generated, the texture images will fit together seamlessly at the edges to give a continuous surrounding image that can be viewed from "inside" in any direction. The panorama is rendered behind all other objects in the scene and rotates to match the current orientation of the camera (it doesn't vary with the position of the camera, which is always taken to be at the centre of the panorama). A skybox is thus an easy way to add realism to a scene with minimal load on the graphics hardware.
Using a skybox in Unity
Unity comes with a number of high-quality skyboxes in the Standard Assets package (menu: Assets > Import Package > Skyboxes) but you can also obtain suitable sets of panoramic images from internet sources or generate your own using 3D modelling software.
Assuming you already have the six skybox textures images, you should import them into Unity with the Wrap Mode set to Clamp rather than Repeat (if you don't do this, the edges of the images will not meet up seamlessly).
The skybox itself is actually a type of material using one of the shaders from the RenderFX submenu. If you choose the Skybox shader, you will see an inspector like the following, with six samplers for the textures:-
The Skybox Cubed shader works in much the same way but requires the textures to be added to a cubemap asset (menu: Assets > Create > Cubemap). The cubemap has six texture slots with the same meanings as those of the Skybox material inspector.
Once it is created, you can set the new skybox as the project default using the Render Settings inspector (menu: Edit > Render Settings). You can override the default skybox for each camera by assigning a new one in the camera's Skybox component (visible in the camera's inspector).