From a281ffa32ea615670d369503692f057b2dc60e6f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 19 Feb 2026 05:19:18 +0400 Subject: 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. --- docs/specs/render.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/specs/render.md') diff --git a/docs/specs/render.md b/docs/specs/render.md index 2994049..ea63197 100644 --- a/docs/specs/render.md +++ b/docs/specs/render.md @@ -87,6 +87,14 @@ Material pipeline на кадре: 4. Резолвятся ссылки на texture/lightmap. 5. Невалидные ссылки обрабатываются fallback-стратегией. +Практическая цепочка привязки для большинства `*.msh` ассетов из `*.rlb`: + +1. Для модели выбирается одноимённый `WEAR` (`.wea`). +2. Из `WEAR` берётся material-слот (по имени, `legacyId` не участвует в выборе). +3. В `Material.lib` ищется `MAT0` по имени (`DEFAULT`, затем индекс `0` как fallback). +4. Из выбранной material-фазы берётся `textureName`. +5. `Texm` ищется в `Textures.lib` (и/или lightmap-архиве для lightmap-ветки). + ## 6. Texture path При резолве текстуры: -- cgit v1.2.3