Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long shader compilation time for Android #802

Open
spirosperos opened this issue Dec 18, 2024 · 1 comment
Open

Long shader compilation time for Android #802

spirosperos opened this issue Dec 18, 2024 · 1 comment
Assignees

Comments

@spirosperos
Copy link

Hello! I'm working on a project involving a Quest 3s (Android) device and Unity. I am currently trying to load a .glb file and visualize it in VR. I'm facing a problem regarding missing shaders, which should be possible to solve by adding UnityGLTF/PBRGraph to the list of always included shaders. However, when I do this I get the following error:

Error building Player: UnityGLTF/PBRGraph has too many Shader variants (1179648)

After taking a look at the issues, I've found this comment saying that I should try preloading the predefined shader variant collection. This leads to a huge compilation time, due to a big number of variants.

image

Is there anything I could do to speed this process up? I'm building using Unity 2022.3.8f1

@hybridherbst
Copy link
Collaborator

hybridherbst commented Dec 18, 2024

Hey, couple questions:

  • Which UnityGLTF version are you using?
  • Are you using URP or BiRP?
  • Are you using any specific renderer features in your URP asset?
  • Did you remove the shader from the "always included shaders" list after adding the premade variant sets?

With the included variant collections this should not happen. Generally, if you want to load any type of GLTF at runtime (as you typically want), then there are relatively large number of shaders to include, but not as many as visible in your screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants