The benefits are in my opinion not so much the transpiling, but rather the ability to write a node somewhere in JavaScript code, save it in some “global” scope, and be able to use it all over the place. You could also write functions to dynamically build nodes like getNode(){ ... }
, save nodes to JavaScript arrays, and just take advantage of JavaScript’s native features. On the other hand, directly writing a shader requires you to call .toString()
on everything from JavaScript world because ultimately a shader is just a big string. Without the node system, everything is just very inflexible, and requires a lot more forethought and planning, which is a waste of brain cycles when the node system is right there ready to be used.