- Home /
ShaderGraph Error "undeclared identifier BuildSurfaceDescriptionInputs / BuildVertexDescriptionInputs"
I have created a project in Unity 2020.3.33f1 from the Universal RP Sample on my Linux machine, I am using Git (with LFS and all the correct settings according to https://thoughtbot.com/blog/how-to-git-with-unity) and now I cloned the project on my Windows 10 machine. When I now open the project, some materials that I created with a custom ShaderGraph are pink, when I open the Shadergraph I am presented with the following error on some (not all) nodes:
Shader error in 'Master': undeclared identifier 'BuildVertexDescriptionInputs' at /Library/PackageCache/com.unity.render-pipelines.universal@10.8.1/Editor/ShaderGraph/Includes/Varyings.hlsl(15) (on d3d11)
and
Shader error in 'hidden/preview/FresnelEffect_2582522f28e24c3798bc9a783b58d96d': undeclared identifier 'BuildSurfaceDescriptionInputs' at /Library/PackageCache/com.unity.shadergraph@10.8.1/ShaderGraphLibrary/PreviewPass.hlsl(13) (on d3d11)
Fresnel Effect is one of the affected nodes, as well as everything that uses it's output. Curiously, the generated code from the fresnel effect contains the following comment:
// $features.graphPixel: $include("BuildSurfaceDescriptionInputs.template.hlsl")
// ^ ERROR: $include cannot find file : BuildSurfaceDescriptionInputs.template.hlsl. Looked into:
// Packages/com.unity.shadergraph/Editor/Generation/Templates
List of things I have already tried: - Installing a different LTS version (no difference) - Restarting unity (no difference) - Making a new URP pipeline asset and assigning it in project settings - Creating a new URP sample project and copying in the shader (the shader works fine) Also, the PackageCache and Packages folder seem to be completely identical to a new URP project, while the ScriptAssemblies seem to differ.
I would gladly appreciate any help, as I am running out of possible fixes. Thanks!
Answer by unity_M2wohqTrVDD0hw · Apr 20 at 12:56 PM
I was very surprised to find out, that moving my project to a different folder fixed the issue. I am not entirely sure, but I suspect that ShaderGraph cannot compile if the path to the project is too long, because I did have a rather long path, and now that it is shorter, the error does not appear anymore.
Your answer
Follow this Question
Related Questions
Shadergraph: Getting normal vectors 1 Answer
Render the scene only using a given a renderType tag 2 Answers
Shader queue tags not working...? -3 Answers
depth mask braking lighting 0 Answers
UI Blur shader not working 0 Answers