[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1063":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":14,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":29,"discoverSource":30},1063,"webphysics","jure\u002Fwebphysics","jure","WebGPU physics engine based on the AVBD solver","https:\u002F\u002Fjure.github.io\u002Fwebphysics\u002F",null,"TypeScript",394,10,2,1,0,4,15,6,50.62,"MIT License",false,"main",true,[],"2026-06-12 04:00:07","[Live Demo](https:\u002F\u002Fjure.github.io\u002Fwebphysics\u002F)\n\n\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff61714a2-8df6-4b7d-b22e-c3722155fe17\n\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\".\u002Fwebphysics-logo.svg\" alt=\"webphysics\" width=\"420\" \u002F>\n\u003C\u002Fp>\n\n[Live Demo](https:\u002F\u002Fjure.github.io\u002Fwebphysics\u002F)\n\n# webphysics\n\nThis project is an **experimental** WebGPU rigid-body \u002F soft-body physics prototype centered on an AVBD-style ([Augmented Vertex Block Descent by Giles et al. (2025)](https:\u002F\u002Fgraphics.cs.utah.edu\u002Fresearch\u002Fprojects\u002Favbd\u002FAugmented_VBD-SIGGRAPH25.pdf)) solver. I ❤ working on [advanced¹](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebgiya) [web graphics²](https:\u002F\u002Fjure.github.io\u002Fnobigi\u002F) [open source experiments³](https:\u002F\u002Fbsky.app\u002Fprofile\u002Fjuretriglav.bsky.social\u002Fpost\u002F3mfar45bfis24), so if you'd like to see more projects like these, please [support my work](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fjure).️\n\n## Setup\n\n```sh\nnpm install\nnpm run dev\n```\n\nBuild for production:\n\n```sh\nnpm run build\n```\n\nNote: This is not a plug-and-play module yet and browser support (Chrome only for now) is limited, it's an initial proof of concept.\n\n## AVBD Pipeline\n\nThe current rigid-body pipeline follows the structure of Algorithm 1 from the AVBD paper, with broad phase, narrow phase, warm-started contact state, colored body solves, dual updates, and final velocity reconstruction. Reference paper: [Augmented Vertex Block Descent by Giles et al. (2025)](https:\u002F\u002Fgraphics.cs.utah.edu\u002Fresearch\u002Fprojects\u002Favbd\u002FAugmented_VBD-SIGGRAPH25.pdf)\n\n1. **Collision detection from the current state `x^t`**\n   The paper starts each time step with collision detection from the current positions, before the solver iterations begin. In this codebase that starts in the main substep orchestration in [src\u002Fphysics\u002FPhysicsEngine.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002FPhysicsEngine.ts), then flows into broad phase and narrow phase.\n\n2. **Broad phase candidate generation**\n   As described in Section 4 of the paper, we first build and traverse an LBVH to get candidate body pairs. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FbroadPhase.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FbroadPhase.ts)\n   - [src\u002Flvbh\u002FGPULBVHBuilder.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Flvbh\u002FGPULBVHBuilder.ts)\n\n3. **Narrow phase manifold generation and warm-start persistence**\n   Once candidate pairs exist, discrete narrow-phase contact generation builds manifolds and preserves per-contact state used for warm starting and friction handling, matching Sections 3.3, 3.7, and 4 of the paper. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FcontactGeneration.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FcontactGeneration.ts)\n   - [src\u002Fphysics\u002Fgpu\u002FcontactRecord.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FcontactRecord.ts)\n\n4. **Per-body constraint list construction**\n   Algorithm 1 is written as “for each body \u002F vertex, iterate over each force affecting it.” The runtime representation of that step is the per-body constraint gather built from contacts, joints, and springs. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FcontactGeneration.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FcontactGeneration.ts)\n   - [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts)\n\n5. **Coloring**\n   The paper uses greedy coloring so all bodies of a given color can be processed in parallel during the primal step. That preparation happens in:\n   - [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts)\n\n6. **Inertial target and primal initialization**\n   Algorithm 1 next builds the inertial target `y`, initializes the primal state, and warm-starts dual \u002F stiffness variables with the `alpha` and `gamma` scaling discussed in Sections 3.6 and 3.7. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts)\n   - [src\u002Fphysics\u002FPhysicsEngine.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002FPhysicsEngine.ts)\n\n7. **Main AVBD iteration: colored primal body solve**\n   For each iteration, and for each color, the solver accumulates inertial and constraint contributions for a body, assembles the local rigid-body system, and applies the AVBD primal update. This corresponds to Algorithm 1 lines 7-25 and the approximate-Hessian discussion in Section 3.5. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts)\n\n8. **Dual and stiffness update**\n   After each primal sweep, dual variables and stiffness values are updated in parallel, corresponding to the augmented-Lagrangian \u002F stiffness-ramp rules from the paper. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts)\n\n9. **Finalize velocities**\n   After the AVBD position solve is complete, velocities are reconstructed from the updated state, matching the final stage of Algorithm 1. Code:\n   - [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts)\n   - [src\u002Fphysics\u002FPhysicsEngine.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002FPhysicsEngine.ts)\n\n10. **Optional post-processing**\n   Sleep and diagnostics are outside the core AVBD paper loop and are optional runtime features in this project. The main orchestration remains in:\n   - [src\u002Fphysics\u002FPhysicsEngine.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002FPhysicsEngine.ts)\n\n## Note on Current Implementation\n\nThe broad pipeline matches the paper closely:\n\n`collision detection -> coloring -> inertial\u002Fprimal init -> repeated colored primal solves -> dual updates -> finalize velocities`\n\nThis is an initial experimental release and further updates will be focused on stability, performance and ease of use. One important implementation difference is that the paper explicitly describes double-buffered position updates for rare same-color conflicts, whereas the current path is still fundamentally an in-place colored body solve in [src\u002Fphysics\u002Fgpu\u002FavbdState.ts](https:\u002F\u002Fgithub.com\u002Fjure\u002Fwebphysics\u002Fblob\u002Fmain\u002Fsrc\u002Fphysics\u002Fgpu\u002FavbdState.ts).\n","webphysics 是一个基于 AVBD 求解器的 WebGPU 物理引擎，用于刚体和软体物理模拟。项目采用 TypeScript 编写，核心功能包括碰撞检测、宽相和窄相处理以及接触状态的暖启动等，这些均遵循 AVBD 论文中的算法结构。当前版本主要作为概念验证，仅支持 Chrome 浏览器，并非即插即用模块。适合于对前沿图形技术感兴趣的开发者或研究者进行实验性探索与学习。","2026-06-11 02:41:26","CREATED_QUERY"]