To make a few shaders work, I have changed the apparently default render mode setting change to multi-pass:
This makes the shaders work, and so far I haven't noticed any adverse side effects as far as I can see. Do you know of any that I might run into with the current setup?
Using:
- Unity 2022.3.40f1
- OpenXR
- SDK 2.6.0
- ML MRTK 1.4.0
- OS 1.11.0
- Alpha blend on rendering extensions
You are correct, switching to multipass rendering allows for better compatibility with shaders that aren't designed for single-pass instancing.
The main downside of multipass is the performance impact, especially on the CPU. Since multipass renders the scene twice (once per eye), it doubles draw calls and culling operations, increasing CPU load. On non-tiled GPUs like the Magic Leap 2, the GPU impact may be less noticeable compared to mobile or tiled architectures, but it can still increase bandwidth usage. In applications that are GPU bound, enabling multipass can actually improve performance by offloading some of the GPU work to the CPU.
I recommend keeping an eye on your applications performance and the Unity Profiler to check if things start slowing down as you add more content. If you notice performance issues you may need look into optimizing the shaders for single-pass instancing again.
Here is a guide that allows developers to enable a HUD that shows some performance metrics about their applications: