Shader variants for RPM avatar missing when loaded in addressable scene

Unity 2022.3.42f1, Ready Player Me Core 7.1.1, Universal RP 14.0.11, Addressables 1.22.2.

I’m encountering an issue with shader variants when loading an RPM avatar into an addressable scene. Initially, everything seemed fine, but I noticed a problem when I loaded an avatar with glasses - the transparency was missing, and an opaque shader was used instead.

After investigating, I discovered that the necessary shader variant was missing, causing Unity to apply a fallback shader. To troubleshoot, I enabled strictShaderVariantMatching in the Project Settings/Player, which resulted in numerous ‘Shader Shader Graphs/glTF-pbrMetallicRoughness, subshader 0, pass 0, stage pixel: variant SHADOWS_SHADOWMASK _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS_CASCADE _SHADOWS_SOFT _SURFACE_TYPE_TRANSPARENT not found.’ errors.

I confirmed that glTFastShaderVariantsURP.shadervariants is included in the PreloadedShaders array, so I’m puzzled by this issue. Interestingly, when I load the RPM character in the built-in scene, it works as expected. However, loading the same scene via Unity Addressables results in missing shader variants.

I’ve created a test project to demonstrate this issue

  • The avatar on the left was built with the addressable scene.
  • The avatar on the right was loaded using the AvatarLoadingExample script.

Here are some observations:

  • If the built-in scene is empty and only loads the addressable scene, the issue is present.
  • If the built-in scene contains the same character with the same lightmap settings, the issue is not present in either the built-in scene or the addressable scene.
  • Manually adding the missing shader variants to the PreloadedShaders array resolves the issue in both cases.
    image

Here is the project for demonstration: GitHub - dnnkeeper/UnityRPMLoadingTest: Issue with Missing Shader Variants in Addressable Scene demonstration

Hi @dnnkeeper and welcome to the Forum!

Please check the following Forum Post to solve this: Avatar appearing different in the build - #6 by Harrison