mac OS packaging error

i am getting the following error when trying to package to macos:
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: Errors compiling global shader FVolumetricFogLightScatteringCS :
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: use of undeclared identifier ‘SampleGlobalDistanceField’
PackagingResults: Error: use of undeclared identifier ‘NumGlobalSDFClipmaps’
PackagingResults: Error: [File:./Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 8619]
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: use of undeclared identifier ‘SampleGlobalDistanceField’
PackagingResults: Error: use of undeclared identifier ‘NumGlobalSDFClipmaps’
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
PackagingResults: Error: appError called: Fatal error: [File:./Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 8619]

then i am getting:

UATHelper: Packaging (Mac): LogAnalytics: Display: [CrashReporter.Release] APIServer = https://datarouter.ol.epicgames.com/. AppVersion = ++UE5+Release-5.3-CL-29314046
UATHelper: Packaging (Mac): Took 486.88s to run UnrealEditor, ExitCode=1
UATHelper: Packaging (Mac): Cook failed.
UATHelper: Packaging (Mac): (see /Users/kyle/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
UATHelper: Packaging (Mac): AutomationTool executed for 0h 8m 8s
UATHelper: Packaging (Mac): AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
UATHelper: Packaging (Mac): RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 25
PackagingResults: Error: AutomationTool was unable to run successfully. Exited with code: 25
PackagingResults: Error: Unknown Cook Failure
LogAnalytics: Display: [UEEditor.Rocket.Release] APIServer = https://datarouter.ol.epicgames.com/. AppVersion = 5.3.2-29314046+++UE5+Release-5.3
LogAnalyticsSessionSummarySender: Sent summary session report for: AppId=UEEditor.Rocket.Release SessionId={7C278C1E-404E-338A-7702-9EBC2EBCF769}
LogAnalytics: Display: [UEEditor.Rocket.Release] APIServer = https://datarouter.ol.epicgames.com/. AppVersion = 5.3.2-29314046+++UE5+Release-5.3
LogAnalyticsSessionSummarySender: Sent summary session report for: AppId=UEEditor.Rocket.Release SessionId={D01AF310-924D-8858-DC6B-1B986D10E4A7}

does anyone know what this means i couldn’t find anything online

Did you solve this? I suddenly get this error in 5.4 on a project that was packaging succesfully before but now I have this error and cannot find what changed…

1 Like

Same problem here:

[File:./Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 10564]
Shader debug info dumped to: “/Users/icn/Desktop/NEW FPS NETO V04/Saved/ShaderDebugInfo/METAL_MRT_MAC/Global/FVolumetricFogLightScatteringCS/364”
use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
/Users/Shared/Epic Games/UE_5.4/Engine/Shaders/Private/VolumetricFog.usf(579,30): Shader FVolumetricFogLightScatteringCS, Permutation 364, VF None:
use of undeclared identifier ‘SampleGlobalDistanceField’
/Users/Shared/Epic Games/UE_5.4/Engine/Shaders/Private/VolumetricFog.usf(602,45): Shader FVolumetricFogLightScatteringCS, Permutation 364, VF None:
use of undeclared identifier ‘NumGlobalSDFClipmaps’
/Users/Shared/Epic Games/UE_5.4/Engine/Shaders/Private/VolumetricFog.usf(604,67): Shader FVolumetricFogLightScatteringCS, Permutation 364, VF None:
use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
/Users/Shared/Epic Games/UE_5.4/Engine/Shaders/Private/VolumetricFog.usf(604,124): Shader FVolumetricFogLightScatteringCS, Permutation 364, VF None:
use of undeclared identifier ‘GlobalVolumeTranslatedCenterAndExtent’
appError called: Fatal error: [File:./Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 10564]

I am also seeing this error when packaging for macOS. Anyone figure it out yet?

Further context: UE 5.4.4 installed build (from EGS), packaging from command line using RunUAT.command. Latest version of Xcode, latest version of macOS Sonoma.

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.

tl;dr: Change Project Settings > Platforms > Mac > Targeted RHIs > Mac Metal iOS/tvOS Desktop Renderer Preview (SM5) to be unchecked


I’m now looking at this commit from 5.3.0-preview-1 in particular (commit hash 345666d on the UE GitHub in case the link below gets lost)

Volumetric Support For Mobile - disabled by default in DP · EpicGames/UnrealEngine@345666d (github.com)

This is the commit that modified how the volumetric fog variables are stored, and also added the DISTANCE_FIELD_SKY_OCCLUSION tags to VolumetricFog.usf

This commit tipped me off that maybe I simply need to disable volumetric fog in my project, since the default is off, but I guess my project had it set to true because the project was made on an older version of UE and ported forward. I verified that the value was set to true in my project as well.

So I disabled it (opened project, entered r.VolumetricFog 0 to the command line), this modified my DefaultEngine.ini to set r.VolumetricFog.LightFunction=False.

Attempting to build again however still results in the same errors: /Engine/Private/VolumetricFog.usf:569:22: error: use of undeclared identifier 'GlobalVolumeTranslatedCenterAndExtent' and the other ones posted in the original post as well…


Edit:

I tested packaging a brand new (Third Person Template) project on UE 5.4.4 and it completed successfully. So obviously there is some setting in my project that is holding over from the fact that it is a project that was created in UE 5.1.X which is leading to this error.

By comparing the project settings, I found that the setting at Project Settings > Platforms > Mac > Targeted RHIs > Mac Metal iOS/tvOS Desktop Renderer Preview (SM5) is responsible for the Mac build failing, when it is set to true.

So yeah, setting Mac Metal iOS/tvOS Desktop Renderer Preview (SM5) to be unchecked lets my MacOS packaging complete successfully.

What is this setting doing then?

Well it sets the RHI that is used on Mac to SP_METAL_MRT_MAC, which I guess is the iOS/tvOS RHI for higher end devices (since it is using Metal MRT), but doesn’t support volumetric fog maybe?

If someone could pitch in on what this setting does more specifically, that would be helpful. I’m honestly not sure why/when I enabled it in the first place.

Hello,

I’m another Apple developer experiencing these same errors.

I’ve tried the options listed in this thread. Disabling “Mac Metal iOS/tvOS Desktop Renderer Preview (SM5)” in the project settings allows packaging the game for macOS.

I still receive the same errors about FVolumetricFogLightScatteringCS when packaging for tvOS. I remain unable to package the game for tvOS because of these errors. Packaging was successful previously in Unreal Engine 5.3.

Any advice to avoid this error would be appreciated.

Cheers.

EDIT: It would appear disabling Project Settings > Platforms - iOS > Rendering > Metal Desktop Renderer allows the project to build for tvOS.