a3a7ff4a6b
Rule A (area-sorted triangle removal) left holes and open boundaries on closed meshes (visible artifacts when zoomed far out). The decimator is now a proper quadric edge collapse: - Collapse: welded u32 topology, per-vertex quadrics (accumulated incident face planes), edge cost = quadric error at the optimal point (clamped to the segment) + edge length, BinaryHeap with a custom Ord (f32 is not Ord; inverted compare, NaN-safe). - Standard GH semantics WITHOUT the new face: both incident pair faces degenerate and are removed; neighbouring faces remap and sweep over the region. Preserves the Euler characteristic and closedness (no holes, no books, no duplicate faces); interior collapse = -2 faces, boundary = -1. Guards: non-manifold edge (>2 faces) or a fold (duplicate sorted triple) rejects the collapse. - welded(): fuzzy welding (1e-6 relative tolerance, grid + 27- neighbour broad phase, exact verify) - trig-generated seams differ by ~1e-16, exact-bit welding missed them. - Root causes fixed along the way: dead face slots are never reused (stale edge/vface entries), vfaces updated on remap, degenerate faces dropped, best-effort target (granularity -2/-1 can land 1-2 off; soft cap, deterministic). - Docs: DRAFT D10, ROADMAP 4.3, ARCHI_CPU_GPU, gpu-driven, lib README, mesh/scene/demo comments - 'greedy decimation / Rule A' replaced by 'quadric edge collapse'. - lod.rs test: deprecated glam perspective alias -> explicit glam::camera::rh::proj::opengl::perspective. cargo test --workspace: 100 passed (94 lib + 3 wgsl + 3 integration), 0 failed; demo runs clean with LOD on.
User documentation — WSG
Usage documentation for the wsg-lib crate: how to build a 3D rendering application
without touching wgpu directly. It targets a developer with basic Rust knowledge; no prior
GPU graphics background is required.
Not to be confused: these pages explain how to use the API. The technical documentation (internal architecture, design decisions, future targets) lives in ../tech/, and the exhaustive API reference is generated by rustdoc (
cargo doc -p wsg-lib --no-deps).
Where to start
- Quickstart — your first window and your first object, in ~30 lines.
- Then, at your own pace, depending on what you need:
| Page | Topic |
|---|---|
| Meshes | Geometries: procedural primitives, custom Geometry, entities and Transform |
| Materials & textures | Appearance: the standard shader, unlit mode, diffuse textures |
| Lights | Directional, point, spot, ambient, MAX_LIGHTS |
| Shadows | Shadow mapping: picking the casting light, the packed-index pitfall |
| GPU-driven rendering | GPU world matrices + indirect draws, opt-in frustum culling |
| Camera & input | Active camera, orbital controller, unified keyboard/mouse state |
| Examples | The 7 repo examples, the advanced manual workflow, adding your own example |
The pages are cross-linked: each page ends with a link to the next one.
Links
- Technical documentation (architecture): ARCHI_APP · ARCHI_RENDU · ARCHI_CPU_GPU · ARCHI_ARENES · FRAME_LOOP
- Root README · ROADMAP · DRAFT
- Full API reference:
cargo doc -p wsg-lib --no-deps