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

Shader error in 'Reallusion/Amplify/RL_SkinShader_Variants_URP' #36

Open
dclipca opened this issue Dec 26, 2022 · 9 comments
Open

Shader error in 'Reallusion/Amplify/RL_SkinShader_Variants_URP' #36

dclipca opened this issue Dec 26, 2022 · 9 comments

Comments

@dclipca
Copy link

dclipca commented Dec 26, 2022

Error building Player: Shader error in 'Reallusion/Amplify/RL_SkinShader_Variants_URP': maximum ps_5_0 sampler register index (16) exceeded at line 432 (on gles3)

Building for Android (OpenXR). How do I solve this?

@dclipca
Copy link
Author

dclipca commented Dec 27, 2022

Only the case for URP. The error doesn't appear when compiling for the standard renderer.

@XiaoMinghui
Copy link

@dclipca hi,have you solve this problem now

@dclipca
Copy link
Author

dclipca commented Mar 2, 2023

@dclipca hi,have you solve this problem now

You got the same issue? I think I might have solved it by disabling fancy skin options (leaving only the basic stuff as the more advanced shader options do not seem to work on Android, VR or both). I switched later custom shader option so my experience with this bug is limited.

@soupday
Copy link
Owner

soupday commented Mar 2, 2023

I've recently recompiled all the URP shaders with sampler macro's, so they should be using at most only 6 or 7 samplers.
But some versions of GLES on android don't support sampler macros and so the Std_Skin_Head material should only use 13 textures, but the wrinkle map system raises this to 30 textures, which obviously won't fit on these devices.

If that's the case:

  1. Don't enable wrinkle maps.
    then
  2. Bake the characters materials, this uses only about 6-7 textures per material.
    or
  3. Uncheck the "Is Head" toggle in the Head material. This will use fewer textures but have less features.
    or
  4. Build with Basic Materials. Everything uses the URP/Lit shader and should work on anything. (if the android target device doesn't support sampler macros then it probably won't perform very well with the full shaders anyway)

There's also the possibiliy that this is a bug in Unity, as some people get this error for no apparent reason. (They have to rebuild the entire project Library to fix it)

@dclipca
Copy link
Author

dclipca commented Mar 4, 2023

I've recently recompiled all the URP shaders with sampler macro's, so they should be using at most only 6 or 7 samplers. But some versions of GLES on android don't support sampler macros and so the Std_Skin_Head material should only use 13 textures, but the wrinkle map system raises this to 30 textures, which obviously won't fit on these devices.

If that's the case:

  1. Don't enable wrinkle maps.
    then
  2. Bake the characters materials, this uses only about 6-7 textures per material.
    or
  3. Uncheck the "Is Head" toggle in the Head material. This will use fewer textures but have less features.
    or
  4. Build with Basic Materials. Everything uses the URP/Lit shader and should work on anything. (if the android target device doesn't support sampler macros then it probably won't perform very well with the full shaders anyway)

There's also the possibiliy that this is a bug in Unity, as some people get this error for no apparent reason. (They have to rebuild the entire project Library to fix it)

How does one disable wrinkle maps? Thank you for the detailed possible solutions.

@dclipca
Copy link
Author

dclipca commented Aug 22, 2023

Bump.

@soupday
Copy link
Owner

soupday commented Aug 22, 2023

It's all in the documentation:

https://soupday.github.io/cc_unity_tools/expression-wrinkles.html

Edit: Does it still do this? I cut out even more samplers in the skin/head shader for 1.5.1/1.5.2.

@dclipca
Copy link
Author

dclipca commented Aug 23, 2023

It seems it's fixed.

@dclipca
Copy link
Author

dclipca commented Aug 23, 2023

Checked right now.

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