Making my own shader widgets in code

Hi there!

I’m enjoying the blueprint shader model immensely. In some ways it’s easier than straight HLSL, in some ways it’s more frustrating.

I was thinking of trying to develop some widgets in code to save myself some time. Specifically I’m after a foreach instance style loop, as well as widgetized versions of some common operations I do that turn out to be quite complex and entail 40-odd widgets in the blueprint view. It’d be preferable to collapse the whole process down to four or five widgets total.

Is this possible? I haven’t looked into the code side of things yet but I have a fair idea of what I can do. Are shader widgets extensible in code?

You can indeed create new nodes, though you’ll need to dive into the rendering code and the shader compiler in order to do so, which is somewhat involved. You can also create Material Functions without having to leave the editor, which may well be worth looking into.

Material functions sounds like what I’m after! Do you have any links to documentation around that?

I’ll have a crack at a member loop node at some point too since it feels like it’d be useful.

It’s just two clicks from the main documentation page…