Here are my findings thus far:
The error is:
use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
in the file
../UE_5.4/Engine/Shaders/Private/VolumetricFog.usf
The variable GlobalVolumeTranslatedCenterAndExtent
is defined in GlobalDistanceFieldShared.ush
In VolumetricFog.usf
, GlobalDistanceFieldShared
is defined behind the DISTANCE_FIELD_SKY_OCCLUSION
tag.
#if DISTANCE_FIELD_SKY_OCCLUSION
#include "DistanceFieldAOShared.ush"
#include "DistanceField/GlobalDistanceFieldShared.ush"
#endif
So if the shaders for my game build properly on Windows, but on MacOS I get errors, then DISTANCE_FIELD_SKY_OCCLUSION
must be getting set false on MacOS, but not Windows.
Sure enough in VolumetricFog.RemapPermutation()
we see
if (IsMobilePlatform(ShaderPlatform))
{
PermutationVector.Set<FDistanceFieldSkyOcclusion>(false);
PermutationVector.Set<FCloudTransmittance>(false);
PermutationVector.Set<FTemporalReprojection>(false);
PermutationVector.Set<FSampleLightFunctionAtlas>(false);
}
where IsMobilePlatform()
returns true if the shader feature level is ES3.1, Metal, or Vulkan. MacOS uses Metal, so FDistanceFieldSkyOcclusion
is set false, and GlobalDistanceFieldShared.ush
is not included in VolumetricFog.usf
I’m not sure yet what changed in UE 5.4 to cause this. It isn’t related to the new Light Function Atlas.