Write real HLSL in a .ush / .hlsl file and get Material Functions, with pins from the signature (UE 5.0–5.8)

Writing HLSL in Unreal’s Custom node usually means pasting code into a small text box, adding every pin by hand, and, on many engine versions, fighting include paths.

I made an editor plugin that reads your .hlsl / .ush files and generates a standard Material Function for each exported function: Function Inputs, a Custom expression with your code, and Function Outputs. You keep the shader code in your own editor and source control; save the file and the Material Functions update in place.

The plugin is HLSL Material Functions (Turn .hlsl / .ush Files into Material Functions), from my studio Haishan. I made this. It is editor-only and was functionally tested on UE 5.0 through 5.8 on Win64 (automation suite and editor smoke tests).

The default Inline (self-contained) mode embeds the code inside the generated asset, so you do not need shader-folder mapping or a C++ module — it works in Blueprint-only projects. In that default mode you can use several Material Functions from the same HLSL library in one material without “redefinition” compile errors (verified on UE 5.4 and 5.8). Pins come from the function signature, including scalar/vector types, default values, Texture2D / TextureCube / Texture2DArray / Texture3D inputs, bool → Static Bool, and out/inout parameters as extra outputs. include is supported (relative paths, extra search directories, virtual path mappings; duplicates removed; cycles and missing files reported). There is a Dry-Run to preview generation without writing assets, a name-conflict policy, and a 14-function sample library called HaishanLib (Noise, UV, Triplanar, Color Math, in 4 files).

It is not a full HLSL compiler: macro expansion, templates, and member functions are not handled. Matrix (floatNxM) and array parameters are skipped. A SamplerState parameter has no pin; it binds to the preceding texture parameter, so put the texture first. /Engine/… includes are not expanded. With Substrate enabled (UE 5.5–5.8), generating Material Functions and compiling them in a material was tested; Substrate-native material graphs were not. The “no redefinition” result applies to the default Inline mode only.

After installing, enable HLSL Material Functions per project in Edit > Plugins and restart. Settings are under Edit > Project Settings > Plugins > HLSL Material Functions. Menus: Tools > Haishan > HLSL > Material Function: Generate All / Dry-Run / Refresh Watches, and Tools > Haishan > Generate from HLSL File…

Fab: [FAB LINK]

Documentation ships in the plugin’s Docs/User folder (User Guide, Quick Start, and FAQ). There is no separate public docs URL in my files.

Support: chanjc03@gmail.com (please include your UE version, the HLSL file, and the Output Log, LogHLSLToMF).

Price: $19.99 Personal / $49.99 Professional

If you already keep shader code in files, I would like to hear where this still gets in the way — especially around includes, pin updates, or regenerating without breaking wires.