[NVIDIA FleX] Cloth TOP is on GitHub

Hi,

I’m posting my Cloth TOP source code and several demos for the community here:

GitHub: Cloth TOP

It supports inflatables and cloth bodies. From the source code you may also find how to use multiple TOP output buffers and CUDA-OpenGL interop.

Cheers,
Vinícius Ginja

6 Likes

Nice! Thanks for the mention in the readme! I’ll try it out.
Curious if you’re managing instancing/destruction on the fly.
One day I should update my other flex/TD experiments (soft bodies with the shape matching constraints…) and share them as well, shame it seems flex is not being updated by nvidia anymore though, as so many of their initiatives.

So instancing/destruction would require a clever buffer management scheme…
I think as it is the best use is to pair multi-body single mesh simulations with complex “anchor” animations like for clothing. Otherwise this is a solid custom TOP template.
I could use your soft bodies code for the soft watches yes.

1 Like

I’ve been looking all over for a way to collide multiple soft bodies with Flex in TD, @vininja would your approach be suitable for this?

The soft bodies from @vinz99 use a different feature as they have volume. I’m using the cloth/inflatable feature from Flex by importing a single SOP mesh, but this mesh can have many detached bodies like in the clocks demo. You can animate points from each body separately sure.

Ok great I’ll give that a try :slight_smile:

Btw it seems none of the examples are showing any output. The DLL gets loaded and there’s not errors (apart from these missing CHOP links)

I’m on version 2020.28110 Windows 10, also tried the latest stable build.

Yes it only writes position and normal data on the last 2 of the 3 color output buffers.

Yes, those also don’t show anything :wink:

Are you using a NVIDIA GPU?

Jup, also installed latest CUDA etc. GTX1080

Tested it here with the console open and getting the following error:
Cuda error: 37 in cudaBindSurfaceToArray(outputSurface2, output2) at C:/Documents/git/TouchDesigner/Plugins/ClothTOP/src/kernel.cu:65

and somewhere in there also found this:

FlexSystem: Reset scene.
Flex: Unmapping a buffer that was not mapped - …\cuda\util.cpp:515

We are both running 1080 btw!

Just did a check on my end, its the same issues

Flex: Unmapping a buffer that was not mapped - ..\..\cuda\util.cpp:515
Cuda error: 37 in cudaBindSurfaceToArray(outputSurface, output1) at C:/Documents/git/TouchDesigner/Plugins/ClothTOP/src/kernel.cu:64

@alphamoonbase @mickeyvanolst The release .dll was compiled for the RTX2080Ti architecture. This release should work for you https://github.com/vininja/ClothTOP/releases/download/0.2/ClothTOP.dll

2 Likes

I’m so psyched about this. Are you on a discord anywhere or anything if I might have a couple questions?

I think the fbx in in your Dali example needs to be locked in the toe you have checked into the repo

Yes catch me on discord. No just download it and put it next to the toe, Ive only locked the textures for that one

1 Like

Cool, I also had a custom flexTOP for fluids faster than the flexCHOP I shared but I think your way of doing the interop is cleaner (I was writing individual pixels through a VBO :D), never got to updating mine