# Material expression custom - relative Include File Path?

**URL:** <https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311>\
**Category:** Asset Creation\
**Tags:** unreal-engine, hlsl, question\
**Created:** [July 17, 2020, 5:57pm UTC](https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311 "2020-07-17T17:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinz9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vinz9](https://forums.unrealengine.com/u/vinz9)\
**Post date:** [July 17, 2020, 5:57pm UTC](https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311/1 "2020-07-17T17:57:05Z")

</div>

Hello,

I was hoping I could use a relative file path pointing to a file inside the content folder, however using /Game/Shaders/myHeader.ush I get the error “Can’t map virtual shader source path …”  
"Directoy mappings are :  
/Engine, /Plugin…  
"

Is there a way to add to this list or somehow have a relative path?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![PurplePerilla1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/purpleperilla1/32/742908_2.png) [@PurplePerilla1](https://forums.unrealengine.com/u/PurplePerilla1)\
**Post date:** [August 10, 2023, 3:12am UTC](https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311/2 "2023-08-10T03:12:59Z")

</div>

\*I had the same problem

---

<div class="post-metadata">

**Author:** ![CoastKid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CoastKid](https://forums.unrealengine.com/u/CoastKid)\
**Post date:** [November 6, 2025, 9:04pm UTC](https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311/3 "2025-11-06T21:04:58Z")

</div>

There’s a solution that works without Visual Studio and C++.  
I test it in two projects in 5.6.

Here are the steps:

1. Close your unreal project.

2. In the root folder of your project, create a folder called “Shaders.”  
(Example: /YourProject/Shaders)

3. Create shader file “MyLib.usf” in that folder .  
(Like this: /YourProject/Shaders/MyLib.usf)

4. Open “MyLib.usf” file and put this code inside:  
struct MyFunc  
{  
float3 Go()  
{  
return float3(1, 0.2, 0);  
}  
};

5. Save MyLib.usf file

6. Open your unreal project.

7. Create Custom node in one of your materials and attach it to the “Base Color” input of your material.

8. Add new “Include File Path” Element in Custom Node properties and type in this text:  
/Project/MyLib.usf  
as value and press enter.  
(Attention! I know, it does look weird because you probably expect it to be “/Shaders/..” or something, do not worry, just continue)

9. Click inside of the code field of your Custom Node and type in this hlsl code:  
MyFunc f;  
return f.Go();

After those steps shader will compile and you will see orange material.

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [February 11, 2026, 11:20pm UTC](https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311/4 "2026-02-11T23:20:17Z")

</div>

@CoastKid Great find. Does that also work with parameters? If for instance, the custom node has parameter that appears in the usf code.
