Skybox and Lights setup: Difference between revisions
(5 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
* ExponentialHeightFog, actor in the Persistent Level, managing the fog. Careful to change its color at night, or the skydome will stay lit. | * ExponentialHeightFog, actor in the Persistent Level, managing the fog. Careful to change its color at night, or the skydome will stay lit. | ||
** Light color | ** Light color | ||
*"PostProcessVolumeWholeGame", this is applied to the whole game, any level. It has Min Brightness=0.5 and Max Brightness=4. If you want your level in game to look like in the editor you need to be sure in game you have the same min/max settings | |||
*Exposure, made of Min Brightness=0.5 and Max Brightness=4. Min Brightness changes based on the time of the day. Max Brightness is fixed = 4. | |||
== 5.1.1 Build All Bug == | |||
In Unreal engine 5.x if you click on "Build All Levels" it will actually break the relight. The same if you click on "Build Geometry" as all the BP containing lights will disappear from the editor until you relaunch it. This causes the lights in BP not to be recalculated. | |||
The solution is to click on "Built Lighting Only". | |||
== Static vs Dynamic lights == | == Static vs Dynamic lights == | ||
Line 123: | Line 130: | ||
[X] Change on the Persistent Level: World Settings -> Volume Lighting Method -> Volumetric Lighmap | [X] Change on the Persistent Level: World Settings -> Volume Lighting Method -> Volumetric Lighmap | ||
[X] Change the skylight to stationary (was moveable). Persistent Level -> skylight | [X] Keep the Directional Light as Moveable. Change the skylight to stationary (was moveable). Persistent Level -> skylight | ||
[X] Disable Distance field, since they would be no longer needed with static lighting. Project Settings -> Engine -> Rendering -> Generate Mesh Distance Fields | [X] Disable Distance field, since they would be no longer needed with static lighting. Project Settings -> Engine -> Rendering -> Generate Mesh Distance Fields | ||
Line 133: | Line 140: | ||
[X] Persistent Level (Yliakum Map file) -> WorldSettings -> Lightmass -> Volumetric Lightmap Details -> 400 (was 200) | [X] Persistent Level (Yliakum Map file) -> WorldSettings -> Lightmass -> Volumetric Lightmap Details -> 400 (was 200) | ||
[X] Added an Unbound Post Process Volume (PostProcessVolumeWholeGame) with min/max Brightness, min=0.5, max=4 . Set with Infinite extent = true | [X] Added an Unbound Post Process Volume (PostProcessVolumeWholeGame) with Lens->Exposure->min/max Brightness, min=0.5, max=4 . Set with Infinite extent = true | ||
[X] World Settings -> Lightmass -> Num Sky Lighting Bounces to 5 (it was 1) | [X] World Settings -> Lightmass -> Num Sky Lighting Bounces to 5 (it was 1) | ||
Line 157: | Line 164: | ||
== Changes 0.7.20 release == | == Changes 0.7.20 release == | ||
[X] Change on the Persistent Level: World Settings -> Volume Lighting Method -> Sparse Volume Lighting Samples | [X] Change on the Persistent Level: World Settings -> Volume Lighting Method -> Sparse Volume Lighting Samples | ||
== Changes 0.7.40 release == | |||
Since long time I was getting this error during relight: "InstancedFoliageActor_0 Large actor receives a pre-shadow and will cause an extreme performance hit unless bCastDynamicShadow is set to false." | |||
I changed Crystal_Light29 from Stationary to Static, and the error went away. We should not have stationary lights impacting landscape. |
Latest revision as of 12:27, 15 December 2023
Elements contributing to day / night cycle
- DirectionalLight, actor in the Persistent Level (Yliakum). Casting light globally in a certain direction.
- Intensity
- Light Color
- SkyLight, actor in the Persistent Level. Stores the color of the skybox and influence all items in the game with indirect light based on the skybox color.
- Intensity
- bp_sky, actor in the Persistent Level, which contains all the logic for rain/snow/fog/... , clouds, time of the day, the actual skybox which is a static mesh (dome).
- Light, scalar parameter on the Material applied to the skybox mesh
- ExponentialHeightFog, actor in the Persistent Level, managing the fog. Careful to change its color at night, or the skydome will stay lit.
- Light color
- "PostProcessVolumeWholeGame", this is applied to the whole game, any level. It has Min Brightness=0.5 and Max Brightness=4. If you want your level in game to look like in the editor you need to be sure in game you have the same min/max settings
- Exposure, made of Min Brightness=0.5 and Max Brightness=4. Min Brightness changes based on the time of the day. Max Brightness is fixed = 4.
5.1.1 Build All Bug
In Unreal engine 5.x if you click on "Build All Levels" it will actually break the relight. The same if you click on "Build Geometry" as all the BP containing lights will disappear from the editor until you relaunch it. This causes the lights in BP not to be recalculated.
The solution is to click on "Built Lighting Only".
Static vs Dynamic lights
I tried with many different settings and Lightmass is crashing on our hydlaa level very often. Trying to create a minimal set of objects exposing the crash seems not possible, as when you delete some objects may stop crashing, but then deleting more seems to stop crashing, so looks like the combination of meshes, not one particular mesh.
The crash happen with SkyLight and DirectionalLight set as Stationary and also with SkyLight as Stationary and DirectionalLight set as Moveable.
The crash does NOT happen with SkyLight as Moveable and DirectionalLight set as Stationary. So we tried this setting, the problem is the size of the generated BuiltData files.
Map | Skylight Moveable, Directional Static | Both Moveable |
---|---|---|
Hydlaa plaza | 530Mb | 139Mb |
Gugrontid | 372Mb | 13Mb |
Ojaveda | 92.5Mb | 53Mb |
Amdeneir | 744Mb | 38Mb |
Given the sizes above, at the end we decided to keep both SkyLight and DirectionalLight set as Moveable.
up to 0.7.7 release values
At noon:
- Fog Inscattering Color: (R=0.313989,G=0.467784,B=0.887923,A=1.000000)
- Skybox Light: 2.0
- Skylight Intensity: 1.5
- Skylight Color: (R=0.853051,G=0.958179,B=1.000000,A=1.000000)
- DirectionalLight Intensity: 4.965001
At night:
- Fog Inscattering Color: (R=0.023549,G=0.035084,B=0.066594,A=0.075000)
- Skybox Light: 0.15
- Skylight Intensity: 0.1125
- Skylight Color: (R=0.988979,G=0.996863,B=1.000000,A=1.000000)
- DirectionalLight Intensity: 0.3
values from 0.7.8 release
At noon:
- Skybox Light: 1.0
- Skylight Intensity: 1
- DirectionalLight Intensity: 2
At night:
- Fog Inscattering Color: 0
- Skybox Light: 0.04
- Skylight Intensity: 0.07
- DirectionalLight Intensity: 0.07
Rebuild lights - size and timings
Foliage set as static lighting
Level | Skylight Moveable | BuiltData size | Skylight Stationary | BuiltData size | Date |
---|---|---|---|---|---|
Hydlaa_X08_Y04 | 10 minutes | 132Mb | 39 minutes | 1493 Mb | 19 April 2022 |
Ojaveda_X11_Y04 | 4 minutes | 43Mb | 6 minutes | 84Mb | 19 April 2022 |
After changing foliage to moveable
Level | Skylight Moveable | BuiltData size | Skylight Stationary | BuiltData size | Date |
---|---|---|---|---|---|
Hydlaa_X08_Y04 | ? | ? | 7 minutes | 201 Mb | 24 April 2022 |
Changes 0.7.19 release
Lights update based on Rycer feedback.
[X] Change on the Persistent Level: World Settings -> Volume Lighting Method -> Volumetric Lighmap
[X] Keep the Directional Light as Moveable. Change the skylight to stationary (was moveable). Persistent Level -> skylight
[X] Disable Distance field, since they would be no longer needed with static lighting. Project Settings -> Engine -> Rendering -> Generate Mesh Distance Fields
[X] Keep the landscape lightmap resolution to 1
[X] Trees, go to Foliage mode, and then click on all meshes part of foliage and set Mobility as "moveable"
[X] Persistent Level (Yliakum Map file) -> WorldSettings -> Lightmass -> Volumetric Lightmap Details -> 400 (was 200)
[X] Added an Unbound Post Process Volume (PostProcessVolumeWholeGame) with Lens->Exposure->min/max Brightness, min=0.5, max=4 . Set with Infinite extent = true
[X] World Settings -> Lightmass -> Num Sky Lighting Bounces to 5 (it was 1)
[X] No Change. Change the static lighting lod to 1 or 2 on landscape only if lightmass crashes
[X] No change. Grass is already dynamic because its placed by the engine
[X] No change. Seems our lightmap resolution is between 32 and 64, overriden by the engine or some of us.
[NO, it was causing too large lightmaps on hydlaa_level] Trees, go to Foliage mode, and then click on all meshes part of foliage and set Mobility as "static" and change Lighting mode to "Force Volumetric", Keep it as lightmap resolution of 8.
Additional Notes:
5) Because of a low lightmap resolution, make the point lights (torches and similar) a combination of a static and dynamic light. One low brightness, high radius static point light (for bounced lighting) and a second light - bright, dynamic with a short radius
6) Careful use of reflection capture. Ideally one per building, some will require more. It would be useful to change their resolution to 64 or even 32 to save memory.
7) Split some underground areas to new streamed sublevels for less streaming hitches, performance optimization and faster loading.
Changes 0.7.20 release
[X] Change on the Persistent Level: World Settings -> Volume Lighting Method -> Sparse Volume Lighting Samples
Changes 0.7.40 release
Since long time I was getting this error during relight: "InstancedFoliageActor_0 Large actor receives a pre-shadow and will cause an extreme performance hit unless bCastDynamicShadow is set to false."
I changed Crystal_Light29 from Stationary to Static, and the error went away. We should not have stationary lights impacting landscape.