On my quest to play around with all the various things in UE4, now my sights have fallen on the material editor and, more specifically, the nodes. I want to see if I can make my own nodes, but after searching through the source code, I cannot seem to find where the actual functionality of the nodes is implemented. All I can find are the node “container” headers and implementation.
I have found some material on creating entire shaders/shader models, but preferably I would like to work on making snippets such as, say, the noise node. For this particular “quest,” I don’t want to rely on material functions (since my primary goal is to add new functionality, not extend on existing ones) or the custom node (since, let’s face it, the custom node is a major pain to work with).
Functionality of the nodes is implemented in HLSLMaterialTranslator
Alternatively, you could make a function in MaterialTemplate.usf and call it from the custom node.
There is absolutely nothing wrong with custom node, apart from being unable to return something larger than float4. ( be sure to vote here), so I have no idea what part of it is causing you so much pain.
Thanks man! With the documentation and the HLSLMaterialTranslator class (and common.usf, which I was able to find thanks to the HLSLMaterialTranslator), I finally found the functionality I wanted to study.
The reason why the custom node is causing me pain to work with is because, well, let’s be fair here, the custom node doesn’t exactly make for a very user-friendly programming environment. No line numbers, size pretty much restricted to 200 pixels or so in width, you cannot use ctrl-f, scrolling isn’t all that intuitive if you use the scroll bar to the right, enter becomes shift-enter, among a few other gripes that are rather minor, but still annoy me to no end. That’s pretty much the reason I am not a big fan. I am aware it’s simply a limitation of it being a node (I know I cannot expect a fully fledged programming environment made specifically for one single node), but still.
Not necessary anymore. Already managed to make a simple random float today that worked like a charm in the material editor. Going to move into custom use files once I get a bigger handle on expression inputs and whatnot.
Hey, I’m trying to do this in UE5.4 in my Plugin now but UnrealEngine/Engine/Documentation/Source/Programming/Rendering/MaterialExpressions/ doesn’t exist on my system, I can’t find it in the engine source.
Can you give me an example of registering a node and connecting to my plugin’s HLSL file?