Pink material

Hi all,

I am currently porting an existing application to VisionOS.

The issue is that all my materials based on MRTK/Standard shader are pink.

I have noticed that on run all my gameObjects are linked to runtime created gameObjects in DontDestroyOnLoad/PolySpatialRoot.
For gameObject using MRTK/Standard, the linked PolySpatial gameObject uses the Sprites/Default shader (pink)
For each gameObject using Unity Standard shader, the linked PolySpatial gameObject uses Unity Standard shader.

Debugging with Unity Frame Debugger tool, I see my MRTK/Standard materials are well rendered during Render.OpaqueGeometry, but then in RenderTransparentGeometry each one is replaced by pink when its linked PolySpatial material is drawn.

I have also this possibility related error in console on run :
“[Platform] Failed to upload NativeTexture: …”

I have tried to port the MRTK/Standard to URP and change the render pipeline of my project to URP but the pink material issue remains.

Thanks for any help.

Unfortunatly, I think I have found the answer to my question here :
https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@0.6/manual/Materials.html

“code-based shaders are not available”.

This is correct (in MR mode): visionOS does not allow the use of arbitrary Metal shaders, so the only materials available are the ones listed in that page of the documentation (URP/Lit, etc.), which map to equivalents in RealityKit such as PhysicallyBasedMaterial, or Unity shader graph materials, which map to ShaderGraphMaterial via a conversion to MaterialX. We do have some limited support for converting HLSL code to MaterialX via the Custom Function Node.