Environment Textures
This is the best way to transfer the illumination of a equirectangular HDR image to your scene.
Equirectangular textures
A equirectangular image is created to convert a 360º view into a 2D texture. It usually has an aspect ratio of 2:1.
If you use HDR equirectangular images (generally .hdr
format) will produce more realistic illuminations. In Poly Haven site you can find a lot of environment textures grouped by categories (outdoor, skies, indoor, night, etc...)
SkyboxEffect
En Evergine, to create an environment lighting from a equirectangular image, you need to create a environment sphere dome with a SkyboxEffect material, that will use the HDR environment texture.
The SkyboxEffect only has 3 useful properties:
Property | Description |
---|---|
Texture | The equirectangular image to use as environment. |
TextureSampler | The SamplerState used to sample the texture. |
Parameters_Intensity | A factor that modify the intensity of the texture. This is used to increase or reduce the brightness of the texture. |
Warning
If you want to use this effect with a common SphereMesh, use the Skybox layer in the LayerDescription property.
Using Skybox material
Steps to create an Environmental lighting using a equirectangular image:
- Import into your Evergine project an equirectangular HDR image.
- Create a new SkyboxEffect material
- Edit the new SkyboxEffect material, and set the Texture property with the imported equirectangular image.
- Assign the Skybox LayerDescription tho the new SkyboxEffect material.
- Now you have two options:
- Option A (reuse the SkyAtmosphere):
- Select the SkyAtmosphere entity, in the MaterialComponent, set the new SkyboxEffect material. This will override the AtmosphereController appearance.
- Option B (create a new sky dome):
- Create a new Sphere primitive in your scene, and assign the new SkyboxEffect material.
- In the new entity, set the Tag property to "Skybox"
- Delete the SkyAtmosphere entity.
- Option A (reuse the SkyAtmosphere):