Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

URP - Shader Graph Disappears after build to Xcode #735

Closed Immerence closed 3 years ago

Immerence commented 3 years ago

Unity bug report case number Case 1312735

Describe the bug Shader Graph disappears from project after build & export to Xcode.

Unity spontaneously reloads the whole project when going back from Xcode.

The result is that "Shader Graph" disappears from Unity's interface. All "Shader Graph" shaders break.

All game objects with "Shader Graph" shaders have Hidden/InternalErrorShader. No option to restore since it can not be found any longer in the dropdown.

Custom shaders created using standard URP "Lit Shader" can not be opened. Impossible to create a new "Lit Shader" from "Shader Graph", menu item is now missing.

URP asset is still active in Graphics > Project Settings.

Reloading project does not help.

To Reproduce

*Using 2020.21f1, ARKit 4.0.10, AR Foundation 4.0.10, Universal RP 10.2.2. 


  1. Add AR Session Origin & AR Session to Sample Scene. 
2. Add a 3D GameObject, e.g Sphere. 
3. Add custom "Shader Graph" shader to GameObject, e.g. "Lit Shader". 
4. Build to Xcode, CMD + B. 
5. Finish build, let Xcode open, let Xcode finish. 
6. Go back to Unity. 
7. Project now reloads after build (?necessary?).

Expected behaviour Building to Xcode does not normally break a whole project.

Actual behaviour Unity breaks the project after building to Xcode. ?Reload shaders again, Not "Shader Graph"?

Desktop (please complete the following information):

Immerence commented 3 years ago

This is most likely due to incompatible Xcode version (11.3.1) used in the project. Something to do with the linking between Unity & Xcode. Updating to latest OS & Xcode release resolved the problem.

mattlandau commented 3 years ago

I have a similar issue, using Xcode 12.4, AR Foundation 4.1.5, iMac with MacOS 11.2.1.

The issue occurs with: Unity 2020.2.6f1, URP 10.3.1, Shader Graph 10.3.1

I reverted back to an older version, and there is no issue with: Unity 2020.1.16f1, URP 8.3.1, Shader Graph 8.3.1

I suspect it doesn't have much to do with AR Foundation.