How can I reference a relative file path in an #include in a custom node?
Hiyo! I'm attempting to smooth over the process of including HLSL files in my materials. So far what I've found is that I can store code for the Custom node in an HLSL file by adding in the custom node's Code property:
As you can see, the path is literal, which introduces a lot of issues with packaging and source control. Is there any way for me to use a relative file path or macro to include these files in source control and packaging? Preferably, the path would reference a path in the project folder.
asked Apr 21 '17 at 07:16 PM in Rendering
I believe you'd have to make it relative to the Engine/Shaders folder, as that's the path from which all the other #includes are resolved.
Be aware that what you're doing is the equivalent of pasting the contents of that file into an HLSL function that the engine generates for each custom node when it's translating the node graph into the code that gets passed to the shader compiler:
That is to say, only code that would be valid in such a context will work inside your
For the custom version of the engine being used at our studio, we've added support for specifying a list of arbitrary
answered Jan 19 '18 at 09:01 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here