brianchirls / Seriously.js

A real-time, node-based video effects compositor for the web built with HTML5, Javascript and WebGL
MIT License
3.88k stars 354 forks source link

Allow for cyclical node graphs #94

Open brianchirls opened 9 years ago

brianchirls commented 9 years ago

Requested by @positlabs in #93, for creating feedback loops and for feeding output back into nodes as sort of an "undo" function.

The algorithm for tracing back through the network from the target nodes will mark each node as rendered for the current pass, to prevent infinite loops. As a result, looped inputs will be one frame behind the current render pass. (I believe puredata works similarly.)

brianchirls commented 9 years ago

Will need to check for loops in all method calls that signal forward or backward:

setDirty doesn't seem to be a problem since it already checks its state. Same for ready/unready.