HLSL #include does not support subfolders

I’m not sure if you’re aware:

#include “Includes\CalcAmbientLight.fx”

tries to include “IncludesCalcAmbientLight.fx” and fails with file not found. It’s stripping the backslashes from the path.

More likely it is treating the backslash as an escape character, but since \c is not a valid escape sequence it just drops the backslash.

If you use a forward slash it will work.

1 Like