Search Unity

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:
    59
    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:
    180
    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.
     
  4. ian_unity431

    ian_unity431

    Joined:
    Oct 12, 2018
    Posts:
    8
    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.