Closed QuackCola closed 4 months ago
You can create your own nodes in tool libraries now
using Sandbox;
namespace Editor.ShaderGraph.Nodes;
[Title( "My Shader Node" ), Category( "Doggy" )]
public class MyShaderNode : ShaderNode
{
[Input( typeof( float ) ), Hide, Title( "" )]
public NodeInput In { get; set; }
[Output, Hide]
public NodeResult.Func Out => ( GraphCompiler compiler ) =>
{
var result = compiler.ResultOrDefault( In, 0.0f );
return new NodeResult( result.Components, $"1 - {result}" );
};
}
Lovely stuff! , seems to work fine on my end :)
For?
S&Box, Other
What can't you do?
Currently you are unable to create a custom shadergraph node that inherits the base node or something like Unary nodetype for example. outside of the shadergraph project. which kind of sucks atm.
How would you like it to work?
Make it so you are able to access Shadergraph stuff from an editor project and or library.
What have you tried?
Just putting the custom node code inside the shadergraph project.
Additional context
No response