How to create my own material node?

I have a shader I’ve written, and I’m trying to bring it into Unreal. I’ve lerned Unreal has a really nice material node system to create shaders for you. There are a couple of things I am unable to replicate though. For one I have a custom struct in my shader, which I don’t know how to expose to the material editor. The second is for some functions in the shader they return a value, as well as use some inout parameters.

Problem #1:
For the struct I wanted to try and create a new material node type to be used in the material editor, but can’t find enough documentation. For now I could work around this problem, by just using the structs internal variables separately in the editor.

Problem #2:
For the functions with inout parameters I need the custom node to return more than just one output. Again if I could adjust the custom node source code, or create my very own node that would be much appreciated.

The other potential solution I’ve found is to put my shader into a plugin, but this seems even more complicated than trying to expand upon the material editor.

Did you look into MaterialFunctions? You can create 1 for your second problem where you have several inputs and outputs.

Unreal’s material editor does not support structs so you’d have to seperate all the variables.

Thank you so much! That was exactly what I was looking for. Also by chance would you have any good links to learning about shaders in plugins. Those sound like something cool to learn.