docs: mark Étape 7 done (Scene cache, Mesh->Material), update PLAN/ROADMAP/README

DRAFT Étape 7: all 24 boxes checked + point d'étape 2026-09-17. PLAN Phase 2
three lines checked (cache in Scene, Mesh->Material, standard_shader default).
ROADMAP 1.2 material facet noted done while the Arc<Geometry> refactor stays
deferred. README declarative snippet updated to register_shader /
add_material_shader / create_mesh / add_entity.
This commit is contained in:
Jérôme Bousquié
2026-09-17 13:16:33 +02:00
parent 62b5cac11b
commit eb5f6aa827
4 changed files with 52 additions and 34 deletions
+10 -7
View File
@@ -93,19 +93,22 @@ impl AppHandler for MyGame {
async fn main() -> Result<(), wsg_lib::utils::WsgError> {
let app = AppBuilder::new().build().await?;
// Register your scene once (string IDs), then App renders it automatically each frame:
// Register your scene once (string IDs), then App renders it automatically each frame.
// Since Étape 7 the Scene owns the pipeline cache: build materials/meshes through it and
// link the material to the mesh (no material_id on the entity anymore).
// app.renderer_mut().set_unlit(true); // select flat 2D rendering (optional)
// app.cache.register_shader("standard", wsg_lib::utils::STANDARD_SHADER_PATH)?;
// app.scene.add_mesh("quad", Arc::new(mesh))?;
// app.scene.add_material("mat", Arc::new(Material::new(app.renderer.format(), "standard", &mut app.cache)))?;
// app.scene.add_entity("my_quad", "quad", "mat")?;
// app.scene.register_shader("standard", wsg_lib::utils::STANDARD_SHADER_PATH)?;
// app.scene.add_material_shader("mat", "standard")?; // build via the Scene's cache
// app.scene.create_mesh("quad", &vertices, Some(&indices), Some("mat"))?; // mesh links its Material
// app.scene.add_entity("my_quad", "quad")?;
app.run(MyGame)
}
```
> API note: `Scene::add_mesh` / `add_material` / `add_entity` and `PipelineCache::register_shader`
> currently return `Result<_, String>` — typed error unification is on the roadmap.
> API note: `Scene::register_shader` / `add_material_shader` / `create_mesh` / `add_entity` and
> `PipelineCache::register_shader` currently return `Result<_, String>` — typed error unification
> is on the roadmap.
## Architecture overview