Login | Register 

top creation freezes some milliseconds

General discussion about anything TouchDesigner

top creation freezes some milliseconds

Postby shieman » Sat Jul 20, 2019 2:23 pm

I made à Light painting app in openframeworks That i ré made in TD.
I created multi fx component in which i can add shader effects component with ui.
All is ok but when i had a New effect TD freezes for some milli seconds.
I then saw That it is the same when i had a top operator from the palette..
I do not have this behaviour in my openframeworks app.
I think the difference is that in openframeworks i only create 2 gpu objects at the beginning And i apply shaders from one to other (fbo ping-pong), whereas in td each top operator create a gpu buffer.
Is there a way to avoid That, cause in TD i can not add my effects in live ?
Posts: 5
Joined: Sat Feb 01, 2014 1:20 pm

Re: top creation freezes some milliseconds

Postby nettoyeur » Sun Jul 21, 2019 2:34 am

Not sure I understand you correctly, but it's not recommended to add new nodes to the network during a live performance. The trick is to build the network with all effects &shaders beforehand, and use nodes like the Switch TOP and the Select TOP to make dynamic changes to your effect routings during a live performance, or for instance use CHOPs or UI button signals to control the values of any dynamic parameters on your GLSL TOPs.
Does that answer your question?
Idzard Kwadijk | freelance TouchDesigner consultant | IdzArd.com
Checkout ChopChopChop.org - the TouchDesigner marketplace!
Posts: 1150
Joined: Mon Oct 15, 2012 12:00 pm
Location: Amsterdam, The Netherlands

Re: top creation freezes some milliseconds

Postby shieman » Sun Jul 21, 2019 4:06 am

Thanks for the answer
You understand correctly.
I extended my Light painting project to a video synth with actually 6 video tracks.
Each track can contain video source And effects. I can not have 50 or more eftects loaded by track....
How other softwares are running, why it is not recommanded to add nodes during live performance ? Is the freeze time due to gpu memory allocation ?
May be c++ top operator wich could dynamically internally add many shaders, like a chain rack could be the solution ?
Posts: 5
Joined: Sat Feb 01, 2014 1:20 pm

Re: top creation freezes some milliseconds

Postby malcolm » Mon Jul 22, 2019 5:13 pm

Hey, your assumption is correct. Adding a node will allocate more GPU memory since that node needs an output that may need to stick around for many frames. We can't just ping-pong between two images since any node's output can be branched off.
Also adding a new TOP can also result in a shader compilation that also takes some time.
User avatar
Posts: 4396
Joined: Tue Nov 13, 2007 1:11 am

Re: top creation freezes some milliseconds

Postby shieman » Wed Jul 24, 2019 7:24 am

Hi Malcolm,

Thanks for the answer.
I did not realised those "problems" since in my openframeworks version, i had not this behaviours.
I want to work with TD since it simplifies prototyping, but i want a "realtime" system without the freezes i encounter when i create sources or effects in my video racks in live performance.

I think (after holidays, end of august) i want to create a c++ TOP operator in openframeworks which could act as a rack :
    - a parameter folder containing the shaders with parameters indications (shader.frag, shader.vert, shader.para)
    - all shaders loaded when top created or folder changed (to avoid compilation time)
    - for each effect created a parameters page created
    - possibility to create, delete, change position of effect in the rack
    - use of 2 buffers (input size), assigned on top creation, in ping pong to apply all the effects of the rack

Then when i would use that TOP Rack, i would use Comp Parameters to assign all the parameters appearing on the top pages.

What do you think about it ?
Is there an other solution ?

Posts: 5
Joined: Sat Feb 01, 2014 1:20 pm

Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: No registered users and 13 guests