update demos et docs

This commit is contained in:
Jérôme Bousquié
2026-09-21 12:01:28 +02:00
parent ef13913464
commit 3dd372410f
11 changed files with 34 additions and 37 deletions
+1 -2
View File
@@ -26,8 +26,7 @@ use crate::core::Frame;
pub trait AppHandler {
/// Called once by `App::run`, right after the window/GPU context are created (winit `resumed`).
/// Use it to register shaders, build Meshes/Materials, and populate `app.scene` before the loop
/// starts. This replaces the pre-`run` setup that was possible before the winit 0.30 migration.
/// Default implementation does nothing.
/// starts. Default implementation does nothing.
/// Inputs: app — mutable reference to the fully-initialized App facade.
fn setup(&mut self, _app: &mut App) {}
/// Called once per frame before rendering begins. Used for physics updates, input processing,
+3 -4
View File
@@ -6,9 +6,8 @@ Contains WGSL shader source files used by the PipelineCache module. These are lo
disk when referenced by their registered ID in PipelineCache.register_shader(). If a file is missing,
PipelineCache falls back to the embedded STANDARD_SHADER constant defined in utils::conf.
Since Step 5, only **one shader** remains: `standard_shader.wgsl` (Phong). The former
`basic_shader.wgsl` was removed as a separate pipeline — flat 2D rendering is now the **unlit
variant** of `standard` (decision ratified in the DRAFT: "2D ⊂ 3D").
The directory contains a **single shader**: `standard_shader.wgsl` (Phong). Flat 2D rendering is
the **unlit variant** of `standard`.
## Files
@@ -21,7 +20,7 @@ variant** of `standard` (decision ratified in the DRAFT: "2D ⊂ 3D").
`standard_shader.wgsl` is WSG's unified (Phong) shader. It exposes the two bind groups shared
by every material (Step 3: a single layout for all).
### Vertex Input Layout (56-byte stride — correspond au `resources::Vertex`)
### Vertex Input Layout (56-byte stride — matches `resources::Vertex`)
| Location | Attribute | Type | Offset (bytes) |
|----------|-----------|------|----------------|
+2 -2
View File
@@ -11,9 +11,9 @@
//! - **app::AppBuilder** reads APP_DEFAULT_TITLE, APP_DEFAULT_WIDTH, and APP_DEFAULT_HEIGHT for default window configuration.
/// Path to the standard (Phong) WGSL shader file on disk (runtime). Used by PipelineCache::load_shader()
/// for file-based loading. This is the unified pipeline shader (Step 3: a single layout for all):
/// for file-based loading. This is the unified pipeline shader (a single layout for all):
/// it carries the full uniform contract (frame + object bind groups) and supports an unlit mode so flat
/// 2D rendering is a special case of the 3D lit path. The `basic` family was removed (Step 5).
/// 2D rendering is a special case of the 3D lit path.
///
/// NOTE: the shipped `assets/shaders/*.wgsl` files are OPTIONAL — when they are absent (library consumed
/// from a checkout without the assets directory, or from a published crate), `PipelineCache::load_shader`