tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
561 stars 97 forks source link

[Enhancement] Unity specific relative #include paths #191

Closed ghost closed 3 years ago

ghost commented 4 years ago

Great work with the extension, it's truly amazing! There's one feature for me (and a lot of other users I'm betting) to be able to use it properly, and that's the unity specific relative #include paths.

Any chance that such a feature could be added?

tgjones commented 3 years ago

Hi @Evurt, sorry for the massive delay in replying! I'm not sure if it's what you are looking for, but you can do this:

{
    "hlsl.preprocessorDefinitions": { },
    "hlsl.additionalIncludeDirectories": [
        "C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/CGIncludes"
    ]
}

... and then you can include Unity files like this:

#include "UnityCG.cginc"
tgjones commented 3 years ago

Closing this in the hope that the above answers your question, but if not feel free to reopen.