# Using (external) HLSL in UE5

**URL:** <https://forums.unrealengine.com/t/using-external-hlsl-in-ue5/2099056>\
**Category:** Rendering\
**Tags:** c-c, c-class-wizard, c-and-bluepri, Post-Processing, c-custommeshcomponen, c-and-blueprint, c-error, c-class, c-custom-shape, c-programming, c-cone-shape, unreal-engine, hlsl, CPP\
**Created:** [November 1, 2024, 1:14pm UTC](https://forums.unrealengine.com/t/using-external-hlsl-in-ue5/2099056 "2024-11-01T13:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kay\_2023](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kay\_2023](https://forums.unrealengine.com/u/Kay_2023)\
**Post date:** [November 1, 2024, 1:14pm UTC](https://forums.unrealengine.com/t/using-external-hlsl-in-ue5/2099056/1 "2024-11-01T13:14:31Z")

</div>

As a UE5 newbie with some graphics programming experience, I scarcely found resources on how to use external HLSL shaders in the engine as you would in other engines like Unity. For this reason I spent the past two months researching this topic and thought sharing my findings here could be helpful to someone who is going through the same problems I did. You can find the link to my blog post here: [Creating shaders in UE5 with HLSL](https://karolinamot.github.io/HLSL-and-ue5-blog/)

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [November 2, 2024, 10:29am UTC](https://forums.unrealengine.com/t/using-external-hlsl-in-ue5/2099056/2 "2024-11-02T10:29:35Z")

</div>

This is great! I will have a read! 🙂

---

<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:09pm UTC](https://forums.unrealengine.com/t/using-external-hlsl-in-ue5/2099056/3 "2025-11-06T21:09:45Z")

</div>

There is also a solution that do not require C++ and Visual Studio:

> [@Material expression custom - relative Include File Path?](https://forums.unrealengine.com/t/material-expression-custom-relative-include-file-path/468311/3):
>
> There’s a solution that works without Visual Studio and C++. I test it in two projects in 5.6. Here are the steps: Close your unreal project. In the root folder of your project, create a folder called “Shaders.” (Example: /YourProject/Shaders) Create shader file “MyLib.usf” in that folder . (Like this: /YourProject/Shaders/MyLib.usf) Open “MyLib.usf” file and put this code inside: struct MyFunc { float3 Go() { return float3(1, 0.2, 0); } }; Save MyLib.usf file Open y…
