- Introduced `render-parity` crate for comparing rendered frames against reference images. - Added command-line options for specifying manifest and output directory. - Implemented image comparison metrics: mean absolute difference, maximum absolute difference, and changed pixel ratio. - Created a configuration file `cases.toml` for defining test cases with global defaults and specific parameters. - Added functionality to capture frames from `render-demo` and save diff images on discrepancies. - Updated documentation to include usage instructions and CI model for automated testing.
50 lines
1.8 KiB
Markdown
50 lines
1.8 KiB
Markdown
# render-demo
|
||
|
||
Тестовый рендерер Parkan-моделей на Rust (`SDL2 + OpenGL ES 2.0`).
|
||
|
||
## Назначение
|
||
|
||
- Проверить, что `nres + msh-core + render-core` дают рабочий draw-path на реальных ассетах.
|
||
- Служить минимальным reference-приложением.
|
||
|
||
## Запуск
|
||
|
||
```bash
|
||
cargo run -p render-demo --features demo -- \
|
||
--archive "testdata/Parkan - Iron Strategy/animals.rlb" \
|
||
--model "A_L_01.msh" \
|
||
--lod 0 \
|
||
--group 0
|
||
```
|
||
|
||
Параметры:
|
||
|
||
- `--archive` (обязательный): NRes-архив с `.msh` entry.
|
||
- `--model` (опционально): имя модели; если не задано, берётся первая `.msh`.
|
||
- `--lod` (опционально, default `0`).
|
||
- `--group` (опционально, default `0`).
|
||
- `--width`, `--height` (опционально, default `1280x720`).
|
||
- `--angle` (опционально): фиксированный угол поворота вокруг Y (в радианах).
|
||
- `--spin-rate` (опционально, default `0.35`): скорость вращения в интерактивном режиме.
|
||
|
||
## Детерминированный снимок кадра
|
||
|
||
Для parity-проверок используется headless-сценарий с фиксированными параметрами:
|
||
|
||
```bash
|
||
cargo run -p render-demo --features demo -- \
|
||
--archive "testdata/Parkan - Iron Strategy/animals.rlb" \
|
||
--model "A_L_01.msh" \
|
||
--lod 0 \
|
||
--group 0 \
|
||
--width 1280 \
|
||
--height 720 \
|
||
--angle 0.0 \
|
||
--capture "target/render-parity/current/animals_a_l_01.png"
|
||
```
|
||
|
||
## Ограничения
|
||
|
||
- Рендер только геометрии (без материалов/текстур/FX).
|
||
- Вывод через `glDrawArrays(GL_TRIANGLES)` из расширенного triangle-list.
|