State of Node-based Shaders in three.js? Any good tutorials?

i have very little experience, always wanted to dig into node based shaders more deeply. but given the following structure:

new A(
  new B(
    new C()
  )
)

if i want to re-use B, or re-plug C into A, reverse the order, etc, everything has to be re-created from scratch. not even sure about multi-connectors (A connected to B and … C?).

in blender nodes are just flat objects, they are not nested, and they connect to one another by reference. that makes it easier for the UI and i think generally that it may be a simpler model. this could be inexperience on my part though, are there any benefits in nesting via constructor?

i made a small test once trying out if it’s feasible to connect flat nodes and it looked OK to me: Bezier curves & nodes - CodeSandbox these nodes could easily be tied to a node editor, re-connected etc.

<Nodes dashed color="#ff1050" lineWidth={1}>
  <Node ref={a} name="a" position={[-2, 2.5, 0]} connectedTo={[b, c, e]} />
  <Node ref={b} name="b" position={[0, 1, 0]} connectedTo={[d, a]} />
  <Node ref={c} name="c" position={[-0.25, 0, 0]} />
  <Node ref={d} name="d" position={[2, 0.5, 0]} />
  <Node ref={e} name="e" position={[-0.5, -1, 0]} />
</Nodes>
7 Likes