Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. 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

Post Processing stack shader errors?

Discussion in 'General Graphics' started by mradfo21, Feb 22, 2019.

  1. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    Hey guys my post processing effects have stopped functioning and I've no idea why. Has anyone else encountered this error?



    Shader error in 'Hidden/PostProcessing/FinalPass': failed to open source file: '../StdLib.hlsl' at line 10 (on d3d11)

    Compiling Vertex program with FXAA
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHTMAP_RGBM_ENCODING





    Shader error in 'Hidden/PostProcessing/Uber': failed to open source file: '../StdLib.hlsl' at line 21 (on d3d11)

    Compiling Vertex program with BLOOM VIGNETTE FINALPASS COLOR_GRADING_HDR_3D
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHTMAP_RGBM_ENCODING





    there was a brief time where turning on Temporal AA would make everything magically work but that seems to have broken. I'm on the latest post processing release 2.1.3

    also note im in 2018.3.0
     
  2. Sethhall01

    Sethhall01

    Joined:
    Jul 17, 2018
    Posts:
    6
    Try using the new nested prefab workflow?
     
  3. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    wow.. okay I actually had to change various post processing shaders from importing this:

    #include "../StdLib.hlsl"


    to

    #include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"


    please get your S*** together here Unity..
     
  4. QiandaDAI

    QiandaDAI

    Joined:
    Oct 18, 2015
    Posts:
    2
    Thanks, I am fixed this one. but I have another problem.

    Shader error in 'Hidden/PostProcessing/SubpixelMorphologicalAntialiasing': failed to open source file: 'SubpixelMorphologicalAntialiasingBridge.hlsl' at line 47 (on d3d11)

    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
     
  5. QiandaDAI

    QiandaDAI

    Joined:
    Oct 18, 2015
    Posts:
    2
    okay, I am fixed this problem. I discovered the included usage has changed from:
    #include "SubpixelMorphologicalAntialiasingBridge.hlsl"
    to the following:
    #include "Packages/com.unity.postprocessing/PostProcessing/Shaders/Builtins/SubpixelMorphologicalAntialiasingBridge.hlsl"
    Becase:



    upload_2019-4-11_19-52-36.png
     

    Attached Files:

  6. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    Can anyone from Unity help me understand why this is happening? How is it possible Unity is shipping builds with errors in the shader compiling of their own post processing stack?

    Im unable to even use Post Processing now as various new shader errors keep showing up across different machines
     
  7. Nightcap_David

    Nightcap_David

    Joined:
    Dec 14, 2017
    Posts:
    11
    I ran into this with Unity 2019.1.0f2.
    Go to the Package Manager and remove and re-install the latest Post Processing package (2.1.6 in my case).
    This fixed the errors for me.
     
    grayworks and srodriguez like this.
  8. bsymon

    bsymon

    Joined:
    Dec 11, 2016
    Posts:
    15
    I ran into this issue a couple of minutes ago ... This is unbelievable to get this kind of crash on a verified package ! How is it possible ?!

    I'm on 2019.1.0f2 with the LRP, on Windows 10.
     
  9. farshidhss

    farshidhss

    Joined:
    Apr 4, 2015
    Posts:
    8
    Same issue for me here! If Uber shader fails I don't know what to do here :(
    Unity 2019.1.0f2, PP: 2.1.6, LWRP: 5.13.0
     
    Last edited: May 4, 2019
  10. farshidhss

    farshidhss

    Joined:
    Apr 4, 2015
    Posts:
    8
    I found a simple solution! Delete the Library and Temp folder inside your project and then open the project again. Unity will rebuild the Library and the problem will be fixed!
     
  11. srodriguez

    srodriguez

    Joined:
    Sep 28, 2015
    Posts:
    1
    This works for me!!! Than you!!!
     
    grayworks likes this.
  12. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    213
    Thanks, this helped my case!
     
  13. Juho_Oravainen

    Juho_Oravainen

    Unity Technologies

    Joined:
    Jun 5, 2014
    Posts:
    34
    Deleting the Library folder is likely an overkill. Re-importing the offending shader should do the trick as well (or re-importing all shaders in the post processing package if you want to be safe).

    This issue has been lurking there for a while but we weren't able to find a solid repro until very recently. The fix for this is being worked on and hopefully lands soon.

    Sorry for the trouble!
     
  14. Yonal

    Yonal

    Joined:
    Feb 18, 2018
    Posts:
    2

    Thanks that worked for me
     
  15. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    62
    how do you reimport the PP shaders?

    Edit- nvm, right click -> reimport :p
     
  16. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,630
    This is still occuring - I switched to an android build from webgl and got a load of failed to open source file errors. Probably not gonna use the post processing any more anyway but this only pushes me to reject it more!
    2018.4.2
     
  17. earrgames

    earrgames

    Joined:
    Jan 27, 2014
    Posts:
    168
    How is this problem fixed in case of custom include files? I have a project which was working fine in u2017x, then, I upgraded the project to u2018.4.11f1 and to my surprise, a lost of shaders are now not working, the error I get is:

    Code (CSharp):
    1. Shader error in 'earr/Retro_VlitRim': failed to open source file: '../MySystems/ShaderIncs/PSXVertAprox.cginc' at line 27 (on d3d11)
    2.  
    3. Compiling Vertex program
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    The shader part is as follows
    Code (CSharp):
    1.  
    2. #include "UnityCG.cginc"
    3. #include "../MySystems/ShaderIncs/PSXVertAprox.cginc"
    4. #include "../MySystems/ShaderIncs/VLitLight.cginc"
    5.  
    The weird thing is that, the shaders seems to compile just fine, till the material is inspected or shown in scene, where the error pops.

    I have tried several ways to name the path with no avail; I deleted the library folder thing, created the assets again (cloned), and nothing. I don't know what else to do, google is not helping much either.

    Please. any help is appreciated, I need to continue with the project. Thanks!.
     
  18. earrgames

    earrgames

    Joined:
    Jan 27, 2014
    Posts:
    168
    I think I know what is going on. I think the paths changed it's root from the current shader file (as in Unity 2017) to the Unity's CGIncludes folder (in the installation dir), I tried by creating a folder in Unity\Editor\Data\CGIncludes and put my .cginc files there, and now they are loaded correctly by the shaders. I'm almost sure this is not the right way and will cause some problems in the future, but I'm tired of googling aimlessly.

    Hope this help someone.
     
  19. MrDizzle26

    MrDizzle26

    Joined:
    Feb 8, 2015
    Posts:
    9
    Wasted half a day on trying to figure out why my PP wasn't rendering... but the reimport fix did the trick!
     
  20. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    698
    started experiencing this
    Code (CSharp):
    1. Shader error in 'Hidden/Internal-DeferredReflections': failed to open source file: 'Assets/ScreenSpaceTechStack/Common/Shaders/Resources/Include_HLSL.hlsl' at line 25 (on d3d11)
    in editor looks ok, in build its completelly glitched as if GPU had broken.

    2020.1.4f1
     
  21. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    698
    deleted Library, issue persists
    upload_2020-11-27_14-23-43.png
    none of theese paths exist in Assets folder. How is this possible!
     
  22. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    698
    after many attemps, reimporting everysingle shader in project seems to have fixed the issue.
     
  23. Ivannovish

    Ivannovish

    Joined:
    Jan 11, 2021
    Posts:
    1
    Esto me sirvió a mi, muchísimas gracias!!
     
unityunity