Search Unity

[RELEASED] Cloth Dynamics

Discussion in 'Assets and Asset Store' started by Nexusmaster, Dec 9, 2020.

  1. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    I used it for hair, but I think there are better assets out there on the store.
    Also I'm rewriting the simulation system, so maybe the new sim system will work better with hair.
     
    ml785 likes this.
  2. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi guys, sorry for the delay, I will try to make a big update this month for CD. But before that, I want to start my crowd funding campaign for my "Unity Improver Projects" mainly "NanoTech", which is a similar tool like Nanite for Unity, which should be interesting for everyone. So till the end of this week I will be working on Nano Tech, after that I will continue with CD and hopefully have a new version ready till the end of this month.
     
    J2T likes this.
  3. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    281
    @Nexusmaster Hello, thankyou for making a GPU cloth solution, it's very appreciated!

    I just bought and play around with the asset. It's a sad part that I found out this asset is not made with swappable clothing in mind. Plenty of games have avatar customization features, and they would have to forget this asset, since each cloth piece and body will have to tie together in the setup phrase.

    Can you think about a way to decouple the cloth and body so that even if they're 2 different prefabs, they can be used together in runtime ( swappable clothes ) ? The current vertex painting workflow for body collision can not support different clothing.

    Also can you expose a method to SetCamera and SetLight for GpuSkinning component, that would be helpful for users who want to set those fields in runtime.
    Thank you.
     
  4. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi, thanks for your input! Yes, I like to make CD more flexible in case of cloth swapping, I think it is possible to make the cloth painting process automatic, I will try some ideas for the next versions. Currently I try to improve the whole system, so this will take some time, but I will make an update soon, at the end of this month, so exposing these methods will be added also. Thank you for your feedback and sorry again for the delay, I hope I can get some more developers involved in this project, to speed up the development.
     
  5. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    281
    Just an idea for decoupling feature :
    - Character prefab have a script named ClothPieceHelper : it have references to collision meshes, and colliders.
    - Cloth prefab have a script named ClothPiece : when it is spawned it will search for ClothPieceHelper in parent, and get all the references it need to setup collision.

    I'm in no way expert in coding, so don't see this as I'm teaching you, just propose ideas ^^.
     
    Nexusmaster likes this.
  6. Excalibur_1st

    Excalibur_1st

    Joined:
    May 6, 2020
    Posts:
    8
    When I installed CD, I got 52 error related to this. Any ideas whats going on? @Nexusmaster

    upload_2022-5-27_16-50-2.png
     
    Last edited: May 27, 2022
  7. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Sorry for the delayed reply, try to remove URP from the package manager and see if other errors pop up, I can't really say right now. Also try to reimport the shaders of CD if you reinstall URP. Also remove HDRP when you don't need it. Let me know if that works, you can also write me a PM. Did you install Burst? Thanks!
     
  8. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi, the new CD version will be ready till the end of the week, I had to prepare some things for the crowd funding which took me more time than planned.
     
    yatsu and NexarChile like this.
  9. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    So, the new version is almost finished, but I found some bugs, that need to be fixed first. In the meantime, take a look at my crowdfunding page, please:

    https://www.indiegogo.com/projects/the-unity-improver-nano-tech/

    The funds will indirectly help to improve Cloth Dynamics, because my plan is to hire freelancers, who will support me with my projects! This will also speed up the development time.
     
    yatsu likes this.
  10. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi guys,

    for the new CD version, I tried to reduce the jittering and make it more stable, already have some good results here:

    But I'm still not done, it will take some more time, but I paused Nano Tech to finish CD next week (hopefully).
     
    wm-VR and NexarChile like this.
  11. victorkin11

    victorkin11

    Joined:
    Apr 20, 2013
    Posts:
    175
    I wonder can it use for VR? since unreal engine nanite isn't support VR(not official support, not work out of the box).
     
  12. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
  13. Diego_Alejo7

    Diego_Alejo7

    Joined:
    Jun 26, 2018
    Posts:
    4
    Hi!!, Do you know why those spheres are produced? And how can I repair it?
    :c Captura de pantalla 2022-06-01 133517.png
     
  14. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi,
    you can try triangles collision or you can change the size of the spheres and move them together via normals offset, so you see less of them.
    CD creates spheres from the vertex points of the body, you can also use the debug render view to see these spheres in the editor (visible in the CarWash scene). If triangles collision is used, it still uses the spheres, but they move perpendicular on the surface of the body to the colliding cloth vertex and get "invisible" this way.
     
  15. fzayguler

    fzayguler

    Joined:
    Dec 1, 2020
    Posts:
    1

    Hello, I would like to try out your asset with my Daz character in Unity. You said you will accept returns in 14 days after purchase but normally Unity assets can not be returned after downloading. Would you still accept returns after downloading and testing it in Unity?
     
  16. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Sorry, I thought I updated the refund policies... since Feb 2022 the Unity team takes care of the refunds, there must be a refund button or something similar after you bought the asset. I could try and ask the Unity team for a refund, but I'm not sure if they will accept it. I'm still working on the new version, maybe you just wait 1-2 weeks, I will try the new version with a Daz character and make a video on how it works.
     
  17. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Still not finished with the CD V2, but I'm almost there, here is a preview of the new collision system in action:

    I want to extend CD to an unified physics system later. Also this runs on mobile and is faster than before. With the new system we now have one solver for all the cloth meshes, each cloth mesh can be added at runtime and can interact via particle points, very similar to Nvidia's Flex system.
     
    Last edited: Jun 17, 2022
    NexarChile, ftejada and yatsu like this.
  18. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    Hey @Nexusmaster! Nice asset you have there. It looks fantastic.

    However, my game uses UMA, and as such it needs somehow generate physics at runtime. I can "preconfigure" things, no problem, but the actual mesh I would use will not be the exact same since UMA uses their own mesh stitching system to generate the characters.

    I was wondering if your asset has a feature that can make it useful to me? Something like, perhaps, a UV texture import system where we can draw what can move and what is pinned then at runtime when we generate that particular mesh, it loads the texture, then loads a "preset prefab" of sorts and boom it magically works together?

    Also how does this support body blendshapes? Breasts, muscles, belly, etc? If I create a character with a big belly, for example, can the shirt expand to fit the new collider size?
     
  19. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    The current version has a texture loader for the vertex painter, but it's not meant for runtime import. I will see if I can add this to version 2. The current version supports blendshapes but also not configured for runtime import. If you go back in the forum pages you will find a post of the blend shapes system.
    [RELEASED] Cloth Dynamics
     
    Last edited: Jun 21, 2022
    Creiz likes this.
  20. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    I'll look forward to Version 2, then.

    There's nothing out there that has UMA support. If your solution becomes the first to offer such a feature...? ;)

    Thank you for your time, regardless :)
     
  21. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    I will test UMA with my new version, maybe it works. I let you know!
     
  22. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Last edited: Jul 8, 2022
    yatsu likes this.
  23. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    ClothDynamicsV2 will still be free for all ClothDynamics users! It still needs more time before I can release it, but I made some good progress the last past weeks!
     
    NexarChile and yatsu like this.
  24. NexarChile

    NexarChile

    Joined:
    Apr 29, 2016
    Posts:
    17
    Hey @Nexusmaster when will you finally release the Cloth Dynamics V2?
     
  25. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Yes, sorry. I have some "collision vs character" issues with the new system, which actually are working better with the old system, I need to fix that first, before I can release it. But I'm aiming for the next month. Sometimes it works faster and sometimes new issues come up, and slow everything down.
     
    NexarChile likes this.
  26. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi guys, again sorry about the delay, I'm trying to fix some bugs with the new version, as you can see here, the character collision of the old version still works better, I currently have to find out why this is the case, because the collision systems are very similar:



    However the performance and the self collisions of the new version are better, so it makes sense to upgrade the system.
    It doesn't make sense to release the new version until this bug is fixed, because I don't think you want these results with the new version.

    I'm trying to make a cloth system that is independent of skinning as far as possible. So the collisions have to work better. Actually the cloth to cloth collisions are working great so maybe if I convert the body into a cloth object it might work better. :)
     
    Last edited: Aug 19, 2022
  27. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Finally, I managed to fix the bug:



    It still jitters a bit, but this is completely without any skinning or damping applied.
    Just pure vertex collisions!
     
  28. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    I think I can get rid of the jittering as well, if I predict the movement of the body vertices I can apply this into the sub iteration of the cloth sim. I think the jittering happens only because the cloth vertices are getting iterated more often and "crashing" into static body vertices, but if the body vertices also continue to move in the sub frames, the jittering can be avoided.
     
    yatsu and ftejada like this.
  29. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    I think I'm going to add air meshes to V2 it looks very promising for multi layered clothes:
     
    yatsu, ftejada and Qleenie like this.
  30. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi everyone,
    sorry I couldn't finish the new version 2 this week, however I finally managed to fix the jittering issue when the body moves, so maybe I can finally release it next week... I still need to update some things, but I'm getting closer to the release, currently no big issues are in the way:


    You have to compare it with the last cloth video I posted, it is a big improvement (the cloth on the right is V2 cloth):
    https://forum.unity.com/threads/released-cloth-dynamics.1019401/page-8#post-8375634
     
    yatsu likes this.
  31. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Btw. the performance is extremely good with V2, I keep on adding cloth and it doesn't really affect the FPS:
    upload_2022-9-23_22-48-16.png
     
    yatsu and ftejada like this.
  32. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Got the triangles collision working again for the body mesh, this way the cloth will better fit the body surface and the sphere collision is not visible anymore:
    upload_2022-9-25_21-36-5.png
     
  33. noers

    noers

    Joined:
    Jun 14, 2022
    Posts:
    2
    It's nice to see your article,I'm still using magicCloth,Encountered serious performance issues on the phone,Have you done any tests on phones? IphoneX above,A dress is about 20,000 vertices
     
  34. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Yes, the new Cloth Dynamics V2 will (hopefully) support all features on modern mobile (just did a quick test on android). The current version is limited to simple colliders only (no vertex/tris collision).
     
  35. noers

    noers

    Joined:
    Jun 14, 2022
    Posts:
    2
    Thanks for your reply,and look forward to V2,but I don't want to replace it for the time being, because I just want to solve the problem of performance,If V2 have a good performance on the mobile phone, I will consider buying
     
  36. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Next week I will take some extra time to finish V2, this week we want to release the new SDF rendering system, sorry again for keeping you waiting :-(
     
  37. greatUnityGamer

    greatUnityGamer

    Joined:
    Aug 11, 2013
    Posts:
    182
    Hi developer of this plugin. I was wondering to buy your product but then it says not support mobile...i don't know what my thing is but I want to use it on Quest 2. And also it says in your product description, something mobile limited to only primitive collisions. That means cloth doesn't work on Characters? Just primitive objects?
     
  38. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi, it means that the collision for mobile is not with vertex points or triangles. However just wait till next week, this week I will try to finish version 2, which has better support for mobile. I will post a video next week where you can see how it works. Be aware of the fact, that it only works with Vulkan (or Metal) on mobile, older phones are not supported.
    Thanks!
     
  39. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi there, so CD V2 is almost done, just adding some new UI and a few minor fixes and I can get it out. I skipped a few new features because I wanted to make a new update now, so more features will be added in a few weeks then first want to give you guys a test run. It's still in beta so there might be some issues/bugs coming up, anyway here is a preview of using the cloth without using any skinning or surface push, just tris collision and sdfs:



    The special thing about this demo is that the cloth is not attached to the skinned character, normally you apply some parts of the cloth to the character body so it doesn't fall off, in that demo it works without it. But it's also possible to use Cloth Skinning and Surface Push like in Cloth Dynamics V1.
     
    yatsu and jcluts like this.
  40. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    So the beta version is almost finished as you can see here, CD2 will be soon add to CD1, you can still use CD1 like before, I also added a bug fix for the vertex welding:
     
    yatsu and jcluts like this.
  41. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    There will be a special support channel for Cloth Dynamics users, I will setup it soon on this discord server:
    https://discord.gg/kKA9UyR4qg
     
    Last edited: Nov 29, 2022
    jcluts and yatsu like this.
  42. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    I finally uploaded the new CD2 beta version! :D
    I think, the main issue at the moment with CD2 is the character support, it works fine in local space but then you have the lack of world collision behavior. Using world space works, but it is not that stable for character movement. At the moment, I recommend using CD1 for characters until CD2 works better, till then you can still have a test run with CD2. I will add a bug report channel for CD here too.
     
    yatsu and NexarChile like this.
  43. messicy

    messicy

    Joined:
    Jan 28, 2015
    Posts:
    4
    Hi,

    I found the init stage will lag for several seconds, is it possible to avoid it? Thanks
     
  44. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi, yes sorry about that, it is due to updating the buffers, I'm aware of this and working on a solution to keep the buffer dynamic.
     
  45. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Hi, just uploaded a new version of the V2 beta on the asset store, should be available in a few days, I fixed the lag at the init stage and updated the compute shader loader. I will test the shaders again this week on Mac and iOS, didn't test it yet on iOS so there might be still some issues. Also I'm planning to get the PS5 support running, but not sure if I can make it this week.
     
  46. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Just found out that the current "Weld Vertices" in ClothObjectGPU can lead to crashes, so please try to avoid it for now and just use "Sew Edges" and "Fix Doubles" until I figured it out.
     
  47. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    365
    Just did a quick character test with the V2:
     
    yatsu and ml785 like this.
  48. Unlight

    Unlight

    Joined:
    Apr 22, 2018
    Posts:
    1
    hello,
    I created a scene with one model from Daz3d. When I tried to compile the project, I found that the compiling shader variants takes an absurd amount of time. I had to stop the process after five hours of compiling.
    what am I doing wrong?
     
  49. pedropla

    pedropla

    Joined:
    Apr 9, 2018
    Posts:
    21
    Hi Chris,

    Did you ever get Cloth Dynamics integrated into UMA? I've been following this great asset for some time and looking forward to when I can use it with UMA and with good performance on mobile.

    For mobile performance, in my case at least, it would be fine if it only interacted with the other mesh items in the UMA character mesh rather than with the world as a whole. This should likely be more performant and fairly easy to implement as UMA has a combined mesh and if only certain areas are cloth they could interact with other areas of the mesh without having to check on colliders or external meshes.

    I know you're probably pretty busy with the Unity Nano Tech project, but just thought I'd check in about this.
     
    Last edited: Jan 17, 2023
  50. robbyzobby

    robbyzobby

    Joined:
    Jun 22, 2013
    Posts:
    1
    Hi! We are have an issues which we struggle to overcome:
    - We have a need of supporting manifold (two-side) mesh, right now only non-manifold mesh simulates properly, do you have any guide how to setup two-side mesh cloth?