Unreal Engine 4.25
Creating HDRI environment backgruond and lighting* in UE4:
Lighting using a panoramic HDRI background is also referred to as IBL – Image Based Lighting.
* The example HDRIs in this post are from www.hdrihaven.com
- Import HDRI environment file.
The file must be saved as a *.hdr file and not *.exr because AFAIK that’s the only way UE4 will recognize it as an HDRI environment and encode it as a Texture Cube (cube map)
- Enable the HDRIBackdrop plugin:
Go to Edit > Plugins
Type “HDRI” in the search field to locate HDRIBackdrop and enable it.
* You’l have to restart the UE Editor before using the plugin
- Drag a Lights > HDRI Backdrop object to your level:
- In the HDRIBackdrop details, select the wanted Cubemap:
- > Set the HDRIBackdrop‘s Intensity (self explanatory..).
> Rotate the HDRIBackdrop around its Z axis to set the environment’s direction.
> Set the HDRIBackdrop‘s Size.
* Make it larger than your whole scene,
And if Use Camera Projection is unchecked make it also large enough so that noticeable objects in the HDRI image will be distant enough as to not move incorrectly when you strife.
* When Use Camera Projection is activated the Size property has no effect.
> If Use Camera Projection is unchecked, set the Projection Center Z value to define the background image height below which it is projected as a flat ground.
> Lighting Distance Factor defines ground projection area that will appear to receive shadows from your scene objects.
* Set this attribute to 0 in-order to turn off the ground projection shadow.
> Use Camera Projection:
Activate this option to get a traditional infinitely far background with no flat ground surface projection.
- Sun & Sky link
- UE4 Architectural Glazing
Unreal Engine 4.21
UE4‘s Directional Light mimics sun lighting and shadow fairly realistically,
And the Atmospheric Fog visual effect produces a realistic clear sky background that includes the sun’s disk image in the sky.
> The Atmospheric Fog produces a result similar to an implementation of a Preetham physical sky model in common rendering software.
Combined together, these two elements can produce an effective day-light system,
But inorder for this to work the sun’s direction should be controlling the time of day simulated by the Atmospheric Fog.
For the Directional light to control the Atmospheric fog:
In the Directional Light’s details, under light, expend the settings and enable:
Atmosphere / Fog Sun Light
There is a limitation to this setup’s realism because the sunlight’s color shouldn’t be pure white, but rather yellowish, to orange, depending on the time of day (you can find tables of the sunlight’s color temperature for various time of day on the web)
There is no problem setting the sun’s color, but the problem is that it causes additional coloring of the Atmospheric Fog which isn’t needed since it already is simulating the sky’s color correctly.
The result of this limitation is that we can see a sunset sky with a white sunlight which is wrong.
I didn’t find a workaround for this yet, can’t find a way to set the Atmospheric Fog‘s sun vector without connecting it to a Directional light and can’t find a way to make the Directional Light‘s color not affect the Atmospheric Fog‘s color.
It seems this limitation can be overcome by disconnecting the Atmospheric Fog from the Directional Light and using the Atmospheric Fog Object’s rotation to control it.