hn.today

Cloth Simulation with XBPD

ricar.do3 points0 comments
Screenshot of Cloth Simulation with XBPD

A small native 3D engine called drie now includes a cloth system based on extended position-based dynamics (XPBD). The solver was moved from the CPU to compute shaders: performance was not dramatically better on the GPU, but the change reduces stutter. Its features include deterministic simulation for reproducible scenes, crease preservation so pleats retain their shape, lower-resolution simulation with finer visual detail, aerodynamic drag, sleep states to save computation, and two-way collisions between cloth and other objects. That two-way interaction also applies between separate cloth pieces, making the handkerchief demonstration a test of how layered fabric behaves.

The main limitations are collisions that let cloth pass through itself or objects. With a coarse mesh, points can slip through gaps, causing folds to tangle or sheets to merge; manual tuning and crease preservation reduce the problem, while spatial hashing helps push overlapping cloth apart. Thin features and sharp corners can still cause fabric to rip through, especially when dragged by tethers that move connected points directly. More gradual force transfer makes the material feel too soft, and signed distance fields are being explored as a way to handle corners, but the issue remains. WebGPU demos show handkerchiefs, fabric draped over furniture, and banners struck by fired spheres. The examples are written in C3 and run through sokol’s WebGPU backend; AI coding tools were used extensively in developing the engine and experiments.

Read on ricar.do0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Laravel Rust

Laravel Rust

Laravel for Rust is a full-stack web framework with routing, validation, database tools, background jobs, and real-time features. It also supports Inertia for frontend integration and is released under the MIT license. (github.com)

The Uberization of Software

The Uberization of Software

Ride-hailing apps greatly expanded demand for trips but undercut the value of taxi medallions and squeezed driver earnings by removing the supply limits that had protected them. The essay argues that software engineering faces a similar paradox: rising demand can lower workers’ pay when technology rapidly expands the supply of labor. (lsrx.net)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.