New cloth simulation demo

Discussion in 'Architecture and Products' started by Humus, Dec 19, 2003.

  1. Humus

    Humus Crazy coder Veteran

    Updated this demo with more springs between the nodes, so the cloth behaves better, though at a performance cost, a lot higher CPU load. Also added a standard GL path for those without GLSL, so it should run at all cards now, but with reduced quality for those without GLSL.

    A little credit goes to Kristof since I finally got around to actually read the ShaderX book I have had some time and found his nice article about cloth simulation, so I used some of the tips there for how to set up the springs.
     
  2. Luminescent

    Luminescent Veteran

    Would it be possible to execute the entire program (aside from api calls and basic ops) on the vpu, with reasonable performance?
     
  3. cthellis42

    cthellis42 Hoopy Frood Legend

    Would it be possible for Humus to teach us how to be more cool--like him--than be less cool--like we are now? :wink:
     
  4. Humus

    Humus Crazy coder Veteran

    Yes, with the right API support. I'm hoping to see the super_buffers extension soon. Then I could just render to a texture and use it as a vertex buffer.
     
  5. KimB

    KimB Legend

    Btw, Humus, I think I noticed a flaw in your program. There doesn't appear to be any conservation of angular momentum.

    That is, if there is a situation with one sphere, off-center, and the cloth falls on it, after contact it should be spinning. It's not, not at all.

    Or, if there is no ball, and the cloth is held at two corners, just falls straight down, and doesn't swing back and forth. Of course, in the real world this will happen if there is very high friction, but I don't see why this should be the case.

    Anyway, I hope that this is just a matter of tweaking a variable, but it doesn't seem right to me the way it's currently set up.
     
  6. Humus

    Humus Crazy coder Veteran

    It's just that I have quite high friction, especially when there's contact with the balls. You can lower the friction and get the effect you're looking for more visible, but then unfortunately the chances of it getting unstable increases too.
     
  7. Daliden

    Daliden Newcomer

    I think there could be a joke to be made of friction and balls, but it's way too early on Monday for that.

    What causes the unstability? I'm guessing that the energy in the cloth as a system only increases, as gravity affects it, but energy is not lost at all in the springs, only in friction. Could something be done about the springs so that they aren't 100% effective, or something?
     
  8. Humus

    Humus Crazy coder Veteran

    I've been thinking about a number of ways to solve it, but haven't found a good way yet. Part of the problem is that it's a discreet system, while reality is continuous. So if it's not sampled close enough in time problems can occur occasionally.
     
  9. GameCat

    GameCat Newcomer

    Instability is always a problem with cloth simulations because you basically use a number of very stiff stick/spring constraints to make a bunch of particles (the vertices in the cloth mesh) behave like a piece of cloth. This means the numerical integration you do becomes very unstable. The best bet for stiff equations is generally to use implicit integration but it's harder to implement and not very effective for moderately complex cloth like the one used in real time demos. It makes much more sense for offline animation.

    There's an old cloth sim I wrote years ago available here which IMHO got the movement of the cloth pretty realistic. It still is a bit stretchy and jittery due to the crappy explicit integration method though. It has very uninspiring rendering but decent physics :)
     
  10. Simon F

    Simon F Tea maker Moderator Veteran

    Humus,
    In the 2002 Siggraph proceedings there was a presentation that described a method of stopping these sort of instabilities. That might be worth a look. (Mind you, I tried (but failed) to convince Kristof to have a look at it for the PowerVR cloth sim so it might be too tricky to implement in a real-time system)
     
  11. gurgi

    gurgi Regular

    You know what would be even cooler? A demo with a human model wearing cloth. :twisted:
     
  12. Humus

    Humus Crazy coder Veteran

    Nice, but waaaaay to fast. You don't get a good sense of what's going on with no timing code and 1000+ fps. ;)
     
  13. Humus

    Humus Crazy coder Veteran

    Found the doc, and it seems quite advanced at first glance. Gonna read it through though and see if I manage to get something useful out of it.
     
  14. GameCat

    GameCat Newcomer

    Well, to my surprise it runs much faster now than it did on the 300 MHz Pentium II in 2000. ;) I vaguely remember putting framerate independent animation code in there, I'll see if I can update the demo.
     
  15. Cyan

    Cyan orange Legend

    please remove,want to move my post to console technology forum
     
Loading...

Share This Page

Loading...