Login | Register 

Simple GPU Cloth Sim

Helpful techniques for working with TouchDesigner. Answers only, no questions.

Simple GPU Cloth Sim

Postby vinz99 » Thu Nov 18, 2010 7:28 am


Still having fun doing sims with GLSL shaders, this time it's cloth from the Stupid OpenGL Shader tricks NVIDIA paper. Rewind to first frame to properly init the sim.

Little demo on vimeo : http://vimeo.com/16806104


Note Added By Derivatve: More up-to-date version for 099 available later in the comments.
(10.63 KiB) Downloaded 1612 times
Posts: 374
Joined: Wed Apr 15, 2009 10:34 am

Re: Simple GPU Cloth Sim

Postby archo-p » Thu Nov 18, 2010 12:04 pm


This is great! I was eying the vimeo last week. You are really cranking these GLSL gems out! I've been very interested in porting more of these kinds of things, but really still don't have a full grasp on the methods. These GLSL physics networks of yours are extremely useful for learning this stuff! Thanks for sharing!

User avatar
Posts: 468
Joined: Thu Nov 19, 2009 3:03 pm
Location: Los Angeles

Re: Simple GPU Cloth Sim

Postby Achim » Thu Nov 18, 2010 1:21 pm

thx so much for sharing all these!

Cologne area TD artists? Let’s get in touch

Posts: 1707
Joined: Wed Nov 14, 2007 1:52 pm
Location: Cologne

Re: Simple GPU Cloth Sim

Postby rodberry » Thu Nov 18, 2010 5:38 pm


this is wonderful. you are really steaming thru the GPU stuff!

the more examples we have in touch the better.code still makes me dizzy, so it's great to have lots of existing stuff that actually works.

I think the touch community is starting to reach a critical mass where lots of cools stuff will happen more easily. I look forward to seeing (and making!) more of it.

User avatar
Posts: 1068
Joined: Wed Nov 14, 2007 2:51 pm
Location: Hobart, Tasmania, Australia

Re: Simple GPU Cloth Sim

Postby vinz99 » Tue Nov 23, 2010 9:00 am

Thanks for the nice words, glad you enjoyed it!
It's been some time since I wanted to try gpu sims, but all the code needed for setting up and swapping textures and feeding parameters always put me off, so touch is great for that :)
Posts: 374
Joined: Wed Apr 15, 2009 10:34 am

Re: Simple GPU Cloth Sim

Postby oliverellmers » Sat Oct 19, 2013 7:22 pm

Hi Guys,

Having a little trouble getting this file to draw anything.. It seems there are no compiling errors with the shaders etc, and everything seems to be running... just no cloth! Wanting to get an understanding of how it works as a base for an up coming project.

I know my problem explanation is a little vague :oops: but any help would be much appreciated!

Ollie :D
Posts: 54
Joined: Sat Dec 22, 2012 11:04 pm

Re: Simple GPU Cloth Sim

Postby vinz99 » Thu Oct 31, 2013 12:13 pm

Hi Oliver,

Just had a look at the file in Touch088 10780, fix was easier than I thought, you just need to put active on for the cache2 top and rewind.
Then the physics2GLSL complains about infinite recursion, which it didn't in Touch077, but it works!

Posts: 374
Joined: Wed Apr 15, 2009 10:34 am

Re: Simple GPU Cloth Sim

Postby matthewwachter » Wed Apr 06, 2016 6:19 pm

Just started playing with this again. I'm trying to turn it into a multi-touch example.

Is there any way to get touch to stop complaining about the recursion loop? Maybe the cache system could be replaced with feedback TOPs? The error is causing weird things to happen in the latest version of Touch.
Posts: 295
Joined: Fri Jul 08, 2011 3:18 pm
Location: Los Angeles

Re: Simple GPU Cloth Sim

Postby vinz99 » Thu Apr 21, 2016 3:47 pm

Hi Matthew,

I'll have a look, I remember seeing that recursion loop error, but can't remember if I could fix it.

Unfortunately the cloth uses a verlet sim that requires position at the last frame and the frame before that instead of storing velocities, hence the cache TOPs. Feedback TOP will only give you the last frame.

I wish in general there was easier/more control about TOPs feedbacks, though it's probably not easy to implement in a node based tool.
Posts: 374
Joined: Wed Apr 15, 2009 10:34 am

Re: Simple GPU Cloth Sim

Postby greenpattern » Wed Jun 20, 2018 1:57 pm

How do you guys get this to appear in render?

Everything seems to work except the render in td99, it appears in geo and camera alright

Anyway I can fix that? this in insanely beautiful!
User avatar
Posts: 231
Joined: Tue Dec 01, 2015 3:05 pm
Location: Edinburgh Scotland, but I'm french


Return to Techniques

Who is online

Users browsing this forum: No registered users and 1 guest