Create an HDRI sky
A High-dynamic-range imaging (HDRI) Sky is a simple sky representation that uses a cubemap texture. You can define how HDRP updates the indirect lighting the sky generates in the Scene.
Tip: Unity HDRI Pack is available on the Unity Asset Store and provides 7 pre-converted HDR Cubemaps ready for use within your Project.
Using HDRI Sky
HDRI Sky uses the Volume framework, so to enable and modify HDRI Sky properties, you must add an HDRI Sky override to a Volume in your Scene. To add HDRI Sky to a Volume:
- In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
- In the Inspector, go to Add Override > Sky and select HDRI Sky.
After you add an HDRI Sky override, you must set the Volume to use HDRI Sky. The Visual Environment override controls which type of sky the Volume uses. To set the Volume to use HDRI Sky:
- In the Visual Environment override, go to the Sky > Sky Type
- Set Sky Type to HDRI Sky.
HDRP now renders an HDRI Sky for any Camera this Volume affects.
Refer to the HDRI Sky Volume Override Reference for more information.
API
To access and control this override at runtime, use the Volume scripting API. Because of how the Volume system works, you edit properties in a different way to standard Unity components. There are also other nuances to be aware of too, such as each property has an overrideState. This indicates to the Volume system whether to use the property value you set, or use the default value stored in the Volume Profile. For information on how to use the API correctly, see Volume scripting API.