diff options
| author | Valentin Popov <valentin@popov.link> | 2026-02-19 04:19:18 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-02-19 04:19:18 +0300 |
| commit | a281ffa32ea615670d369503692f057b2dc60e6f (patch) | |
| tree | 321bcc1bfc489e2e7d0ff10dae620864ab08d054 /crates/render-demo/README.md | |
| parent | 18d4c6cf9fabc18282b29d103c8d30024f66e49b (diff) | |
| download | fparkan-a281ffa32ea615670d369503692f057b2dc60e6f.tar.xz fparkan-a281ffa32ea615670d369503692f057b2dc60e6f.zip | |
feat: Enhance model and texture loading with improved error handling and new features
- Introduced `LoadedModel` and `LoadedTexture` structs for better encapsulation of model and texture data.
- Added functions to load models and textures from archives, including support for resolving textures based on materials and wear entries.
- Implemented error handling for missing textures, materials, and wear entries.
- Updated the rendering pipeline to support texture loading and binding, including command-line arguments for texture customization.
- Enhanced the `texm` crate with new decoding capabilities for various pixel formats, including indexed textures.
- Added tests for texture decoding and loading to ensure reliability and correctness.
- Updated documentation to reflect changes in the material and texture resolution process.
Diffstat (limited to 'crates/render-demo/README.md')
| -rw-r--r-- | crates/render-demo/README.md | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/crates/render-demo/README.md b/crates/render-demo/README.md index 0a1fb45..32d85ef 100644 --- a/crates/render-demo/README.md +++ b/crates/render-demo/README.md @@ -5,6 +5,7 @@ ## Назначение - Проверить, что `nres + msh-core + render-core` дают рабочий draw-path на реальных ассетах. +- Проверить текстурный path `WEAR -> MAT0 -> Texm` на реальных ассетах. - Служить минимальным reference-приложением. ## Запуск @@ -26,6 +27,20 @@ cargo run -p render-demo --features demo -- \ - `--width`, `--height` (опционально, default `1280x720`). - `--angle` (опционально): фиксированный угол поворота вокруг Y (в радианах). - `--spin-rate` (опционально, default `0.35`): скорость вращения в интерактивном режиме. +- `--texture <name>`: явное имя `Texm` (override авто-резолва). +- `--texture-archive <path>`: путь к архиву текстур (по умолчанию `textures.lib` рядом с `--archive`). +- `--material-archive <path>`: путь к `material.lib` (по умолчанию соседний `material.lib`). +- `--wear <name.wea>`: имя wear-entry внутри модельного архива (по умолчанию `<model_stem>.wea`). +- `--no-texture`: отключить текстуры и рендерить однотонным цветом. + +## Авто-резолв текстуры + +Если не передан `--texture`, демо пытается взять текстуру из игровых данных: + +1. `model.msh -> model.wea` (первый wear-материал), +2. `material.lib` (`MAT0`) по имени материала с fallback `DEFAULT`, +3. первая непустая `textureName` фаза материала, +4. загрузка `Texm` из `textures.lib` (или `lightmap.lib` как fallback). ## Детерминированный снимок кадра @@ -43,7 +58,16 @@ cargo run -p render-demo --features demo -- \ --capture "target/render-parity/current/animals_a_l_01.png" ``` +Явный выбор текстуры: + +```bash +cargo run -p render-demo --features demo -- \ + --archive "testdata/Parkan - Iron Strategy/animals.rlb" \ + --model "A_L_01.msh" \ + --texture "PG09.0" +``` + ## Ограничения -- Рендер только геометрии (без материалов/текстур/FX). -- Вывод через `glDrawArrays(GL_TRIANGLES)` из расширенного triangle-list. +- Используется только базовая texture-фаза (без полной material/fx анимации). +- Вывод через `glDrawArrays(GL_TRIANGLES)` из расширенного triangle-list (позиции+UV). |
