- Home /
"Can't open include file "HLSLSupport.cginc""
I'm getting this error in all of my pro shaders that include "HLSLSupport.cginc", but I can't find any information on this error, as if nobody has ever gotten it before. One of my projects has this error, but another one of mine, also created before I used Unity Pro, compiles these shaders just fine. I'm guessing this project isn't finding HLSLSupport.cginc, but I have no idea where to start in fixing this. If this file resides somewhere in the system or in the project, I have no idea where. Does anybody know how to fix this?
Answer by ScroodgeM · Jul 20, 2012 at 08:40 AM
the one way to fix this is to give this file to shader compiler by default (for Windows) all '...inc' files are stored in folder
[program files folder]\Unity\Editor\Data\CGIncludes\
so try to locate it there and if there's no this file, find one from correct installation and put it there
Answer by Wappenull · Aug 30, 2021 at 05:57 PM
One (stupid) pitfall I found about includes in shader is
If one of the include fails, it fails all built-in also. (Thus those misleading error message about built-in cginc missing, which is outside user's responsibility)
For example, if you have shader "Assets/Shaders/a.shader" which has CGINCLUDE
, and custom includes that says #include "Extra/ColorUtil.cginc"
(expects Assets/Shaders/Extra/ColorUtil.cginc
) and you dont have it. You get complain about built-in!
Credit this finding to this blog (Japanese) https://dkrevel.com/failed-to-open-source-file/
Your answer
Follow this Question
Related Questions
Grabpass refraction masking 0 Answers
When can I use Shader.EnableKeyword()? 1 Answer
Triangulate image in realtime 0 Answers
How to prevent shader optimizations? 1 Answer
Splat Map with transition texture? 0 Answers