Avatar appearing different in the build

image
image

Hello, why do the glasses of the avatar look opaque in the build?
Everything is fine in the Unity Editor.

Hey! What configuration do you use to request the avatar? For example, if you request textures in JPG format, then these do not support transparency.

I use AvatarObjectLoader().LoadAvatar(avatarUrl); I have no idea what format the texture is.

However, isn’t that supposed to also be opaque in the Editor if I’m using the same code? Unless the format is somehow changed for builds is what you’re saying??

In that case, how do I ensure the format stays PNG (or whatever it is in the Editor) in the build??

It could be some build setting that affects shaders. What target platform are you building for?
When building for Android, for example, by default the Unity quality settings are lower so it would use a “mobile” shader.

Where can I find this setting?
I’m building for Windows and the Editor is also Windows if that helps.

The shader is not being included into builds, at least not the transparent version it seems.
Sometimes this can be caused by the default Quality settings located at File > Build Settings > Player Settings > Quality and then adjusting the quality level as needed. This is typically something that effects building for mobile platforms though.

You can also force Unity to include the specific shader (or shader varient) that uses transparency. In you case the simplest way to do this would be as follows.

  1. load the avatar with the transparent accessory in Editor (via our Avatar Loader window)
  2. With the scene open go to the Project Settings > Graphics tab
  3. Scroll down to where you see shader loading and beneath that you should see “Currently Tracked:” shaders and a button “Save to Asset”.
  4. Click the Save to Asset button and choose somewhere to store it. Then be sure to add it to the “Preloaded Shaders” list just above the button.
  5. Rebuild and the transparency should be fixed.

Thank you. This fixed the issue.