jspdown / cloth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloth Simulation

This is a cloth simulation project that uses extended position based dynamic (XPBD) and small step techniques. The project is implemented using WebGPU and the simulation runs entirely on the GPU.

Demo

You can see a live demo of this project at this link.

Installation

To run this project locally, follow these steps:

  1. Clone the repository to your local machine:
git clone https://github.com/your-username/cloth-simulation-project.git
  1. Navigate to the project directory:
cd cloth-simulation-project
  1. Install the dependencies:
yarn install
  1. Start the development server:
yarn start
  1. Open Google Chrome and go to localhost:3000 to see the project in action.

If you are on a Linux machine you need to install the latest google-chrome-unstable version. Then, chrome will have to be started using the following parameters:

google-chrome-unstable \
        --enable-features=Vulkan,UseSkiaRenderer \
        --enable-unsafe-webgpu

Tested on Google Chrome (dev) >= Version 104.0.5083.0

Usage

To use the project, you can interact with the cloth simulation by clicking and dragging on the cloth surface. You can also adjust various parameters such as the bend and stretch compliance using the control panel on the right side of the screen.

Implementation

This project is based on the following papers:

The simulation runs on the GPU using a parallel Gauss-Seidel (constraint graph coloring).

About

License:MIT License


Languages

Language:TypeScript 92.6%Language:JavaScript 4.6%Language:CSS 2.3%Language:HTML 0.5%