Files
wsg/lib/examples
Jérôme Bousquié bfe68f4393 docs: Étape 14 (shadows) finale — bilan DRAFT, ROADMAP §4.2, README roadmap
- docs/DRAFT.md: document vidé (bilan Étape 14 archivé dans l'historique git)
- docs/ROADMAP.md §4.2: Shadows marqué [x] (Étape 14, mono-lumière PCF)
- README.md: item 12 de la roadmap (shadow mapping)
- cargo fmt --all sur les sources Étape 14
2026-09-19 19:04:12 +02:00
..

Examples

Each .rs file in this directory is a standalone example auto-discovered by Cargo (cargo build -p wsg-lib --examples). To run an example:

cargo run -p wsg-lib --example <name>
Example Command Description
simple cargo run -p wsg-lib --example simple Flat unlit quad (minimal declarative workflow, AppBuilder + auto scene).
cube cargo run -p wsg-lib --example cube Textured cube (procedural checker) lit by a directional + point + spot light.
manual cargo run -p wsg-lib --example manual Low-level workflow: Context, Renderer, PipelineCache, Mesh used directly (no App facade).
spot_test cargo run -p wsg-lib --example spot_test Spot-light isolation: only one spot is on (near-zero ambient), cube rotates on two axes so the oriented beam is clearly visible.
shadow_test cargo run -p wsg-lib --example shadow_test Shadow mapping (Étape 14): one directional light is the shadow caster (set_shadow_caster(Some(0))); a cube casts a PCF-softened shadow onto a thin ground slab.

Conventions

  • Examples are self-contained: no assets loaded from disk (procedural textures, hardcoded geometry).
  • They use the declarative workflow (AppBuilder + Scene) except manual, which bypasses the App facade.
  • When adding a new example: create a .rs file in this directory, document it here, and reference it in the root README if appropriate.