Unofficial Hacker News client - receive Push Notifications on replies.

Cloth Simulation with XBPD (opens external site)

51 points by ricardobeat 2 days ago | ricar.do | 18 comments on HN | Vote on HN (opens Hacker News)

Comments (18)

  1. The Handkerchiefs demo is pretty sweet. How could you do that light/flare through the windows?

    Nice demos, indeed.

    Replies (3)
    1. If it's shadowmap based lighting you can trace through it.

      Imagine a ray from the camera to the background pixel, sample the shadowmap along the way if the sample points along the camera ray lies within the shadowmap and add light if the shadowmap depth is further away (simplified, depending on number of lights,etc there's a number of possible optimizations but that should be googleable).

    2. light through the window looks like standard volumetric rendering, a custom lens flare effect, and some (not sure if physically accurate) blooming of image values beyond the dynamic range in this scene.
    3. Thank you :)

      The light uses a froxel volumetric fog [1] implementation. The flares are bloom + a rendering from the camera POV, the lens reflection reprojected a few times.

      [1] https://www.mattiasstrand.com/posts/volumetric-fog/

  2. Typo in the headline, PBD stands for Position Based Dynamics.
    Replies (2)
    1. The article literally links a paper on XPBD, apparently some kind of extension of PBD with better behaviours (unless the headline has changed?).

      https://matthias-research.github.io/pages/publications/XPBD....

      Replies (1)
      1. I'm quite familiar with it, and contributed to the implementation in Cinema4D; what I meant is that the HN title says "XBPD" not "XPBD". (I seem to have something like the opposite of dyslexia so the whole internet is just one giant mess of typos.)

        PS. Mad respect for being in TPOLM!

        Replies (1)
        1. Ah right! Takes a while to see it even in this reply when you've typed it out, I guess the fonts we use don't help (though the capped letters probably rarely appear together even in acronyms).

          Also thanks, though I feel like I've mostly been a minor party (though there was some stuff that never got released back in the day).

    2. Ah, good catch! I probably mistyped it, the blog post is correct. Couldn't edit the submission though.
      Replies (1)
      1. As it is the title perfectly describes my last relationship.
  3. FYI: this article drops a hotlink[1] which leads to pinball[2]; it's fun.

    1: https://simonbw.com/pinball-performance-2/

    2: https://pinball.simonbw.com/

    Replies (1)
    1. This runs at like 10x speed for me on Chrome and Firefox, weird.
  4. In the handkerchief demo video the cloth pieces seem to bounce off the ground which looks really odd
    Replies (1)
    1. The goal was to make it behave like linen, but it does look a little rubbery. It's also reduced precision for the web version. Still some fine-tuning to do, thanks for checking it out!
  5. If you don't have WebGPU enabled, https://claude.ai/artifact/YV3wTiemkwoKcBthirFp33 has a cloth simulator that works without it
    Replies (1)
    1. The stack I'm using is targeting WebGPU only unfortunately, as the engine is built for native, web is just one of the outputs.

      The model is quite different though - XPBD is physically based and independent of frame rate (great for VRR), you get control over stretchiness and bends, and adding steps only improves accuracy without changing behaviour. It also lets you deal with constraints more naturally, that's what enables the self-collision for example.

      Replies (1)
      1. Runs great on iphone, thanks for sharing!
  6. These days a lot of startups are using vision models for quick try-on clothes and seeing products in your home. These are funded by YC. I will add links later. Not saying they are better than cloth simulation.

    I had a startup in the this space. For some reason, virtual tryrooms never caught on with people.