Shader Graph Custom Nodes

Hello,

I am not managing to create a simple custom node for shader graph. I followed the tutorial available at Shader Graph Custom Node API: Using the Code Function Node | Unity Blog

But still, the shader graph won’t display my custom shader. I’m using Unity 2019.1.9f1, and Lightweight RP 5.7.2.

Given that, are we still able to create custom nodes for this version of Unity and Lightweight? What am I missing?

I haven’t really worked with shader graph yet, however did you actually follow the turtorial to the end? In other words does you class have all necessary methods and did you attach a Title attribute to the class? If that attribute is missing it won’t show up anywhere.

Thanks for the reply! I followed the tutorial until the part where I add the Title attribute above the class. At this point, I should already have a working node.

In case you want to see it, I pasted my code below. Maybe there is something I am missing.

using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;

[Title("Custom", "My Custom Node")]

public class MyCustomNode : CodeFunctionNode
{
    public MyCustomNode()
    {
        name = "My Custom Node";
    }

    protected override MethodInfo GetFunctionToConvert()
    {
        return GetType().GetMethod("MyCustomFunction",
            BindingFlags.Static | BindingFlags.NonPublic);
    }

    static string MyCustomFunction(
        [Slot(0, Binding.None)] DynamicDimensionVector A,
        [Slot(1, Binding.None)] DynamicDimensionVector B,
        [Slot(2, Binding.None)] out DynamicDimensionVector Out)
    {
        return
            @"
{
	Out = A + B;
} 
";
    }

}