Problem with shader in mobile build

Hello,
I am trying to make an AR app with Unity using Depth Kit.
While everything seems to work in the editor, as soon as I build the project, the video player shader fails to compile and inside the app shows a purple box. Then in the editor the shader is also rendered as a purple box. To get the shader working again (in the editor) I have to re select it from the “Failed to compile” shader category.

To setup the project I import these packages:

  • Depthkit Core (with the sample prefabs, not AV Pro)
  • Depthkit Core Shader Graph (and the sample prefabs)
  • Depthkit Core VFX Graph (without the refabs)

Am I importing something wrong, or not importing something important?

Thanks

Hi, @stakek - Thanks for posting, and apologies that you’re having this issue.

To help troubleshoot, can you provide the following:

  • Which Unity version you’re working in
  • Which render pipeline the project is using (Built-in, Universal RP, HDRP?)
  • Which Android device you are testing
  • Which Android version you are testing
  • Can you also share screenshots of how your Depthkit object is configured in the Inspector?

I’ll keep an eye out for your responses and go from there.

Hello,

  1. I am trying with both 2020.3 and 2022.3
  2. I have tried with the Built-in and URP
  3. Redmi Note 8 Pro and Samsung Galaxy A53
  4. Android version 11(Redmi) and Android 13 (Samsung)
  5. Photos

On shader the path is: Failed to compile - DepthKit - Core - DepthKit Core Photo Look Build in RP

I can share the project as well if you need it.

Thanks.


After Build Core Shader

Main Camera

After Build Shader

Core Shader Graph Inspector

Main Scene

Phone Screenshot

Shader

@stakek Thanks for sharing these materials.

Based on the devices you are building to and the fact that their GPUs are both Mali-based architecture, you may be experiencing the same issue as the ones found here and here relating to the graphics hardware in some Android devices, and their inability to support the compute shaders found in the Depthkit Unity SDK. This is one of the reasons that Android support is listed as experimental in our Unity platform support documentation.

Do you have any Adreno-based devices to test on?

Yes, I tested on Realme 8 Pro and it works fine.

Thanks for your help

@stakek Glad to hear it works on the other device. Unfortunately, the Android hardware ecosystem encompasses a wide array of devices with different capabilities which makes it challenging to maintain compatibility with all of them. We have prioritized Android devices which are used most by Depthkit customers such as the Meta Quest 2, Pro, and upcoming 3; Others like the Redmi Note 8 Pro and Samsung Galaxy A53 contain the hardware constraints I mentioned, and are not as widely used with Depthkit, and therefore not part of our test bed.

One other note: My team also pointed out that the pink/magenta volume can appear if the incorrect look is applied to the Depthkit asset. This can happen if:

  • The Built-in Look is applied to a Depthkit asset in a project using the Universal Render Pipeline (URP) or High-Definition Render Pipeline (HDRP).
    *The Shader Graph Look is applied to a Depthkit asset in a project using the Built-in Render Pipeline.
  • Both Built-in and Shader Graph looks are applied to a single asset.