Commit Graph

11 Commits

Author SHA1 Message Date
Jérôme Bousquié 26a3cda6f6 feat(shaders): add standard Phong shader with uniform contract (data only)
Étape 2 du plan 3D+Phong : nouveau shader unifié, non encore branché à un
pipeline (Étape 3 : infra uniforms).

- shaders/standard_shader.wgsl : contrat vertex complet (position/normal/uv/color,
  56 octets, corrige la défaut latente du basic) ; 2 bind groups formative frame
  (view/proj/cam_pos/light_dir/light_color/options) + object (model) ; éclairage
  hemisphérique ambient + diffuse directionnel; mode unlit (options.x) pour que la
  2D plate soit un cas partticulier de la 3D.
- utils/conf.rs : constantes STANDARD_SHADER_PATH + STANDARD_SHADER (include_str!).
- tests/wgsl_validate.rs : validation hors-ligne naga (via wgpu::naga, aucune
  nouvelle dépendance) tant que le shader n'est pas compilé par un pipeline.
- shaders/README.md : documente le contrat standard et le statut du basic.
- Erreur WGSL corrigée en validation: cast mat4x4->mat3x3 non supporte, remplacé
  par construction explicite de la sous-matrice 3x3.
- Validation: cargo test (naga OK), check workspace+examples 0 warning, doc OK, fmt OK.
2026-09-16 15:55:26 +02:00
Jérôme Bousquié 252db88980 feat(lib): expose Camera and Entity with Transform (data foundation)
Étape 1 du plan 3D+Phong : fondations de données sans toucher au rendu.

- resources: exporte Camera (fichier auparavant orphelin), migre les fonctions
  glam dépréciées look_at_rh/perspective_rh_gl vers glam::camera::rh::* (induit
  par la compilation de camera.rs, sinon 2 warnings).
- scene: nouveau type Entity { mesh_id, material_id, transform } (scene/entity.rs);
  Scene::entities passe de HashMap<String,(String,String)> à HashMap<String,Entity>.
- API: add_entity conserve sa signature (transform identité par défaut), ajout de
  add_entity_with_transform, entity_transform, set_entity_transform; iter_entities
  rend désormais aussi le &Transform. renderer et examples inchangés a posteriori.
- Validation: cargo check --workspace et examples 0 warning, cargo doc 0 warning, fmt OK.
2026-09-16 15:26:16 +02:00
Jérôme Bousquié bb7fab4911 docs(plan): lock uniform scheme (2 bind groups) and uniform types location (resources/uniform.rs) 2026-09-16 13:40:30 +02:00
Jérôme Bousquié 14e18cda06 docs(plan): unify on a single pipeline layout (2D as degenerate 3D) 2026-09-16 12:06:56 +02:00
Jérôme Bousquié f81144918a docs: detailed plan for 3D+Phong step in DRAFT.md 2026-09-16 11:46:33 +02:00
Jérôme Bousquié 0a7ebf62ad docs: erase DRAFT scratchpad content for next step 2026-09-16 11:16:48 +02:00
Jérôme Bousquié 628c125925 docs: move DRAFT.md into docs/ and confirm step decisions
DRAFT.md now lives in docs/. Confirmed the pending design decisions:
render() auto-renders the scene by default (Option A, alternative B removed),
and simple.rs uses app.renderer.device()/format() via the library API
without importing wgpu.
2026-09-16 10:23:42 +02:00
Jérôme Bousquié 2cc79be2ec spec OKF pour doc 2026-07-31 19:09:46 +02:00
Jérôme Bousquié 7b25564483 doc 2026-07-08 15:46:50 +02:00
Jérôme Bousquié 6c94fc96d6 ajout material et pipeline_cache 2026-07-06 10:40:00 +02:00
Jérôme Bousquié 4fd39d32c6 configure context 2026-07-03 21:11:43 +02:00