Simple Skybox material is used to fill empty space in the camera view with a cubemap texture.
This example uses Simple Skybox to fill the camera view with a custom equirectangular cubemap.
Set Up with Simple Skybox Material
You can add a Simple Skybox material by going to + Add asset > Material > Simple Skybox.
To correctly use the Simple Skybox material, you will need a Cube mesh in the scene.
Try to use cube instead of other meshes for the skybox since cube has minimal vertex and will perform better.
Since the skybox will need to cover the whole camera view, you will need attach the Cube under the Camera, and set its Position to 0, 0, 0 in the Cube’s inspector panel.
Change the Cube’s default material to the Simple Skybox material we just added. After correctly setting up the scene, you will see all the background is changed to a grassland.
Apply Custom Cubemap Texture
To change the skybox background, you will need a custom cubemap texture. Currently, we only support the equirectangular panorama format of the cubemap image. To add the cubemap texture to the project, you can go to + Add asset > Import > Cubemap, and in the pop up window, select the cubemap texture.
After importing the cubemap texture, it will appear in the Assets panel, and now you can select the texture in Simple Skybox’s inspector panel.
Skybox Texture: The cubemap type texture that will be applied to the skyboxColor: Apply tint color on the skybox
Exposure: The parameter that controls the brightness of the skybox material.
Rotation: Change the rotation of the skybox.
Render State 0
Depth Test: If depth test should be performed and compared in the depth buffer.
Depth Function: How should the depth testing be performed.
- Never: The depth test never passes, and the object will never be rendered.
- Less: Draw the part of the object when it is in front of the existing objects. And hide the parts that are behind the existing objects.
- Equal: Draw the part of the object that is at the same depth as the existing objects, and hide the parts that are in front or behind the existing objects.
- LessEqual: Draw the part of the object that is in front or at the same depth as the existing objects, and hide the parts that are behind the existing objects.
- Greater: Draw the part of the object that is behind the existing objects, and hide the parts that are in front of the existing objects.
- NotEqual: Draw the part of the object that is not at the same depth as the existing objects.
- GreaterEqual: Draw the part of the object that is behind or at the same depth as the existing objects, and hide the parts that are in front of the existing objects.
- Always: The depth test always passes, always render the object with the material.
Depth Write: Control if the geometry depth are written to the depth buffer. Turn it off if you are rendering objects that are transparent.
Color Mask: Select the RGB and alpha channels which will be prevented from writing to channels in the render target.
Cull Mode: Polygon has front and back sides. If you choose Back, it means don’t render polygons that face away from the viewer. Front mode means rendering polygons inside faces. Front and Back mode will disable render either sides so the object will disappear. None mode will make both inside and outside faces renderer.
Blend Mode: Please refer to our Blend Mode guide.