Search Unity

Question any method to use enums with custom function nodes?

Discussion in 'Shader Graph' started by XRA, Feb 5, 2021.

  1. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    Ideally the way I would do this is using some of the Shader Graph C# classes and just write a node in the same way all ShaderGraph nodes are implemented, but all the code is internal.

    How can a user create advanced shader graph nodes with Enum dropdowns without using the internal classes? It seems impossible but curious if anyone has insights on this. (that don't involve making the ShaderGraph package local and just adding code into it)

    An example would be the supplied BlendNode it has an enum for the blending type which changes the code output, or the TransformNode.

    The brute force option would be to just make sub graphs for each possible use-case, which will work, but would be so much nicer to just have a single node with enum dropdowns.

    Imagine having each BlendNode as a separate node type, having to delete the node, rehook all wiring etc.. really bad for iteration...
     
    Last edited: Feb 5, 2021