Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Cloth Folding
#2
(04-10-2022, 09:27 PM)obitwokenobi Wrote: I think it should all work, but one thing I could not find any info about, except here on the forum where the founder has said that Obi Cloth cannot be scaled.

With Unity Cloth, scaling the transform will actually fold(albeit awkwardly) the cloth. Is it possible to simply fold an Obi Cloth the same way?

Hi!

Yes, you can just scale the transform that the cloth is attached to. This can be the cloth transform itself, just like Unity's cloth.

The limitation of "not being able to scale ObiCloth" is the same as with Unity's built-in cloth: scaling the cloth will scale the attached points, instead of making the cloth physically smaller. If you want to make the cloth smaller at runtime, you need to scale the solver component instead.

(04-10-2022, 09:27 PM)obitwokenobi Wrote: Say I have a square sail cloth hanging down.
I want to pull the bottom particles up (1 fold)and then I want to pull the middle particles up(second fold) and then pull up the particles between middle and top for the final (third fold).
Best case scenario(what im trying to achieve): The sail looks packed up and not catching any wind.

Yes, this will all work fine.

(04-10-2022, 09:27 PM)obitwokenobi Wrote: First off is it possible to modify particles like that at run time? And second is it possible to set this up for a ship with 30 sails? And finally have you ever tested how many sails can be simulated at once? Would you think 200 sails(outlier max case in my game) is performant maybe I can set the simulation iterations to 2 instead of 1 as I saw in your YT tutorial thats the main "performance slider" for obi cloth.

"Amount of sails" isn't really a valid metric, since we don't know how complex each sail is or how often they're updated. It all depends on the spatial resolution of your sails and the spatial resolution of your simulation.

Assuming "normal" resolution, 30 sails per ship sounds like a lot, 200 is downright impossible. Let's assume each sail is 20x20 (400 vertices/particles per sail, which is rather conservative). That would mean 400*200 = 80000 particles. Using 2 iterations per frame would mean 80000x2 = 160000 particle updates per frame. No CPU-based physics engine will be able to handle this much, and most GPU-based ones will have a very hard time. And this is considering a single ship in your entire game!

If you really need that huge amount of sails, I would advise to animate them procedurally since simulation isn't really an option no matter the engine you choose.

kind regards,
Reply


Messages In This Thread
Cloth Folding - by obitwokenobi - 04-10-2022, 09:27 PM
RE: Cloth Folding - by josemendez - 05-10-2022, 07:59 AM
RE: Cloth Folding - by obitwokenobi - 05-10-2022, 01:21 PM
RE: Cloth Folding - by josemendez - 05-10-2022, 01:39 PM