I am studying how to use sky atmosphere material integration, and I have learned from Sjoerd De Jong’s tutorial Exploring the depths of the new Sky & Atmosphere system | Unreal Engine and doc about Sky Atmosphere material expressions’ definitions and how to apply them to render a basic sky environment.
Unfortunately, I still don’t know how to apply the material expression node SkyAtmosphereLightIlluminance in the scene; it was mentioned in both Sjoerd’s tutorial and doc, and the tutorial introduced how to use the most of material nodes except it, and I don’t really understand the definition of it from the doc:
The SkyAtmosphereLightIlluminance
expression takes in the Atmospheric
Light Index for a Directional Light
and outputs illuminance reaching the
skydome world position (see note
below). This is illuminance, so it
needs to be integrated against a
BxD/phase function to get luminance to
accumulate. A multiplication with a
uniform phase function of 1/(4π) is a
good starting point.
After looking into the HLSL implementation of this node, I found the node return the atmosphere light color multiply by the transmittance of a pixel (which the shader function works on, sample from transmittance LUT). The code looks like this:
float3 MaterialExpressionSkyAtmosphereLightIlluminance(FMaterialPixelParameters Parameters, float3 WorldPosition, uint LightIndex)
{
#if MATERIAL_SKY_ATMOSPHERE && PROJECT_SUPPORT_SKY_ATMOSPHERE
const float3 PlanetCenterToWorldPos = (WorldPosition - ResolvedView.SkyPlanetCenterAndViewHeight.xyz) * CM_TO_SKY_UNIT;
// GetAtmosphereTransmittance does a shadow test against the virtual planet.
const float3 TransmittanceToLight = GetAtmosphereTransmittance(
PlanetCenterToWorldPos, ResolvedView.AtmosphereLightDirection[LightIndex].xyz,
ResolvedView.SkyAtmosphereBottomRadiusKm, ResolvedView.SkyAtmosphereTopRadiusKm,
View.TransmittanceLutTexture, View.TransmittanceLutTextureSampler);
return ResolvedView.AtmosphereLightColor[LightIndex].rgb * TransmittanceToLight;
#else
return float3(0.0f, 0.0f, 0.0f);
#endif
}
Can anyone explain to me what does this node means and how to use it?
Thanks in advance!