Freeze when cooking/uncooking a GLSL component

Hi,

I was wondering how to avert freezing time when I want to cook / uncook a component that include GLSL nodes.

I get 4 or 5 freezing seconds when I swith from one component to an other.

disabling/enabling cooking manually will often cause stutters and should be avoided.

TD is pull-based, which means nodes only cook if their output is requested by other nodes. Have you tried a Switch TOP to switch between the output of your COMPS?
The COMP whos output is not requested will stop cooking automatically.

Tahnk you Idzard for this information.

One more question, is it the same procedure for BASE COMP?

Hi Julien,

this pull-based design works for any node in TouchDesigner. Read more on this page on the wiki what causes cooking.

Also this piece of text further down that page:
TouchDesigner is a “pull system”. A common misconception with cooking in TouchDesigner is that cooking starts upstream and moves downstream. For example if you have Constant CHOP connected to a Math CHOP, most people assume if you change a value in the Constant CHOP then the Math CHOP is forced to cook. This is incorrect. Almost all operators will only cook when something is interested in their data. What this means in our example is that while changing a parameter in the Constant CHOP will make it ‘dirty’, it won’t cook until someone asks for its data. So the Constant CHOP won’t cook until the Math CHOP asks for its data. The Constant CHOP may cook for other reasons, like if its viewer is on (ie. the user is asking to see its data).

When you see the wires between nodes animating, it means the upstream node is cooking, the downstream node(s) may or may not be cooking. You can also see if a node is cooking by middle-clicking on it.

So this means, you can and should setup your whole network using Switch and/or Select SOP/DAT/CHOP/TOPs to only take what data you need at the end for your current scene, which will take care that only the parts of your network that contribute to your output are cooking.

1 Like

Also a side note with shaders, there may be a shader error or warning being printed out repeatedly to the TouchDesigner text console (different from the textport). You can make an environment variable called TOUCH_TEXT_CONSOLE and set it to one and you’ll see a small command line that opens up alongside your TouchDesigner window. Worth checking that as well. Things like shaders and C++ operators print to there.

1 Like