Exploring the depths of the new Sky and Atmosphere system - jgoffeney/Cesium4Unreal GitHub Wiki

Back

Introduction

Basics

To add a new sky to a level you have to play with directional light settings and then add a Sky and Atmosphere Actor. This is all that is necessary for adding a sky.

  • Directional Light Settings

    • Starting with a basic world scene (terrain, vegetation, no sky)
    • Add a directional light to the scene (Place Actors->Lights->Directional Light)
    • Switch to Lit mode (View Mode menu within the viewport) to see the results in the editor
    • Within the light settings:
      • Set the light Intensity to 12 lux (to make it look nice).
      • Under advanced setting enable Atmosphere Sun Light
  • Sky Atmosphere

    • Add Sky Atmosphere actor to scene (Place Actors->Visual Effects->Sky Atmosphere)
      • Automatically provides atmosphere shading and renders the sun
      • The sun's location can be adjusted with the SkyAtmosphere actor selected by using ctrl-L and move the mouse. The time of day lighting updates automatically.

Settings

The Sky Atmosphere Actor has additional settings for finer control.

  • Planet
    • The planet radius effects the the atmosphere and can be adjusted under Planet subsettings.
  • Light Scattering
    • Rayleigh Scattering
      • Light scattering from atmospheric gases
      • If set to 0 then there is no scattering so the sky is black
      • With a thicker atmosphere the sky gets redder
    • Mie Scattering
      • Light scattering from dust, smoke and water droplets
      • As it increases you get more of a foggy appearance (as expected since that is what fog is)
    • Absorption
      • Light scattering from ozone
      • Effects the overall color of the sky especially around the sun
  • Additional
    • The colors can be set to make more alien skies.

Space View

The Sky and Atmosphere rendering is based on attitude so you can view the planet from space. As you travel up the atmosphere will thin and darken.

  • Setting variables to effect view

    • Camera Speed in Viewer
      • Increase to move around large areas
      • Camera Speed set to 6 with Camera Speed Scalar of 64.
  • SkyAtmosphere Actor->Planet->Transform Mode

    • Sets how the SkyAtmosphere is positioned with respect to the planet
    • By default it is attached to the top of the planet but can be changed and moved independently
  • Moon

    • You can add properly scaled moons and they will automatically blend with the atmosphere. You can go to them and have them at planetary scale.
  • Important Cvars

    • r.SkyAtmosphere.SampleCountMax 64
      • Quality of atmosphere rendering
    • r.SkyAtmosphere.FastSkyLUT 0
      • When enabled improves performance over quality (may add a hitch to transition from ground to space)
    • r.SkyAtmosphere.AerialPerspectiveLUT.FastApplyOnOpaque 0
      • When enabled improves performance over quality (may add a hitch to transition from ground to space)
    • r.SkyAtmosphere.AerialPerspectiveLUT.Depth 96

Material Integration

This section is demonstrating how to alter the sky using materials. The presenter dropped in a mesh called SM_SkySphere in the scene and then he dropped the unfinished material M_BasicSkyMaterial onto it. The sky in the scene updated with the unfinished material. I am not sure how the connection works between the SkySphere and the original sky actor. There appears to be a material property of isSky which may do it.

When opening the material editor for M_BasicSkyMaterial 6 modes are available.

  • Aerial Perspective
    • Sun's wide glow/tint
  • DistantLightScatteredLuminance
    • Atmosphere ambient light/tint
  • LightDirection[0]
    • Angle of directional light
  • LightDiskLuminance[0]
    • The circle representing the sun
  • LightIlluminance[0]
    • The atmosphere intensity/color of sunlight hitting the atmosphere
  • ViewLuminance[0]
    • The atmosphere gradient

This section was not super clear for my level of knowledge and was pretty rushed.

Cvars, Tips and Tricks

  • Blending with Heightfog
    • The Visual Effects->Atospheric Fog is not compatible with new system
    • Instead use Visual Effects->Exponential Height Fog.
      • Drag into the world and fiddle with parameters.
      • By default it does not interact with Sky and Atmosphere (change sun location and fog looks the same)
        • In Project Settings->Engine Rendering->Shader Permutation Reduction enable Support Sky Atmosphere Affecting Height Fog
        • In the Exponential Height Fog set Fog Inscattering Color and Directional Inscattering Color to black to enable the sky color to be additive with the fog and look correct.
        • Using it as a blueprint you can use OnTick to update the fog to change properties based on time of day.
  • BP Driven parameters
    • A brief description of what you can and can't do with the current version in the editor view. Showed large graphs of functionality to allow for eclipse of sun and moon.
  • Important Cvars
    • r.SkyAtmosphere.MultiscatteringLUT.HighQuality 1
      • Better quality of scattering on ground and space
  • Stars Cubemap
    • An experimental approach using a Post Process Volume with a blendable which allows the stars to be visible at night and blend with atmosphere
    • Blends a star cubemap with the furthest away pixel, checks if on surface or in space, detected the brightness of the atmosphere.
  • Real Time Sky Capture
    • The Sky Light has an option Real Time Capture which enables the sky to be dynamically reflected in real time. The previous version required a regular update at a performance cost.
  • High Quality Settings
    • The presenter uses a variety of settings which are on the video at this time
    • It makes it look pretty.

Volumetric Clouds

  • Basics
    • Sun interacts with clouds with translucence and god rays and darkening of environment
    • The actor Visual Effects->Volumetric Cloud is placed in the world and it primarily depends on a volumetric cloud material.
  • Material Authoring
    • Starts with volumetric texture to define the 3d shape of a cloud
    • Various other textures are blended on top.
  • Key Cvars
    • This was not actually mentioned.
    • r.SkyAtmosphere.DistanceToSampleCountMax
    • r.VolumetricCloud.SampleCountMax
    • r.VolumetricCloud.TracingStartMaxDistance
    • r.VolumetricCloud.TracingMaxDistance
    • r.VolumetricRenderTarget.Mode