Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

All shaders fails to open source file custom *.cginc

Discussion in 'Linux Editor' started by lassade, Mar 23, 2018.

  1. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    72
    Well guess the title says it all no matter what shader I have in the Assets folder if includes a custom *.cginc it will fail to compile. Funny thing is that I'm having this error with shaders of both PostProcessingStack and TextMesh Pro packages.

    Any ideas?

    Using 2017.3.0f1 on Fedora 26
     
  2. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    185
    I am having this issue too on build & run for Windows
     
  3. drumit84

    drumit84

    Joined:
    Aug 25, 2014
    Posts:
    1
    Make sure your shader file if it includes other files has the right folder structure. I ran into this also after I moved my files around into different folders. It is basically breaking the connection between the custom files.

    IE: In my shader file I include a resource file. I used to just have it here in the root like this.

    #include "/CustomShaderFile.cginc"

    So when I moved my custom shader into a new folder I had to change the structure so it looked in the right folder.
    #include "../ShadersFolder/CustomShaderFile.cginc"

    Hope this helps.
     
    PaulUsul and a436t4ataf like this.
  4. ian_unity431

    ian_unity431

    Joined:
    Oct 12, 2018
    Posts:
    10
    Also, if you re-named the .cginc file and you know the path of to the include is correct in your shader, try closing Unity and re-opening the project. That fixed my issue.
     
    a436t4ataf likes this.
  5. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    983
    Same bug still in 2019.2+ - if you reference a custom .cginc file and move either the .cginc, or the shader, to a new subfolder then you get a bunch of fake errors about missing core CGInc files (which are definitely NOT missing), and the Inspector shows a long list of errors for all the core CGI files that Unity now claims it cannot find (although obviously it can, because they haven't moved :))
     
  6. HVRAT

    HVRAT

    Joined:
    Aug 28, 2018
    Posts:
    11
    Right click the shader and reimport fixed my problem.
     
    BayernMaik, pcg and Hari1101 like this.
  7. re-cheid

    re-cheid

    Joined:
    Apr 10, 2017
    Posts:
    16
    Had the same problem, reimport fixed this but make sure Visual Studio is closed while reimporting
     
unityunity