diff options
| author | Valentin Popov <valentin@popov.link> | 2026-07-18 14:58:24 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-07-18 14:58:24 +0300 |
| commit | a59f16d6b5895af58a36c16b041c3edaf882b3fd (patch) | |
| tree | d997f2ce5ac82b71403c06a671cb55ce8dcd1aef /docs | |
| parent | fea984ddf51ba1e56ce800b9f370ac4208dcfcab (diff) | |
| download | fparkan-a59f16d6b5895af58a36c16b041c3edaf882b3fd.tar.xz fparkan-a59f16d6b5895af58a36c16b041c3edaf882b3fd.zip | |
fix(render): match Ngi32 camera matrices
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/tomes/05-render.md | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/docs/tomes/05-render.md b/docs/tomes/05-render.md index 07add33..7c1fba7 100644 --- a/docs/tomes/05-render.md +++ b/docs/tomes/05-render.md @@ -1398,13 +1398,14 @@ RVA `0x7030` exactly builds the row-major D3D7 projection from renderer FOV ```text [ cos(f/2), 0, 0, 0 ] -[ 0, h/w * cos(f/2), 0, 0 ] -[ 0, 0, z/(z-n), sin(f/2) ] -[ 0, 0, -n*z/(z-n), 0 ] +[ 0, w/h * cos(f/2), 0, 0 ] +[ 0, 0, sin(f/2)*z/(z-n), sin(f/2) ] +[ 0, 0, -sin(f/2)*n*z/(z-n), 0 ] ``` -The sine in the homogeneous-W term is intentional: after the D3D perspective -divide the diagonal has the expected cotangent scale. RVA `0x9450` applies a +The sine in the depth scale and homogeneous-W term is intentional: after the +D3D perspective divide the diagonal has the expected cotangent scale and the +depth range remains finite. RVA `0x9450` applies a specific axis permutation/sign change and translated dot products to selector 0 before the view `SetTransform`; it is not merely the generic affine inverse. @@ -1562,23 +1563,30 @@ hashes промежуточных buffers. Без такой трассиров [materials](../reference/materials.md), [Texm](../reference/texm.md) и [render frame](../reference/render-frame.md). -### Live AutoDemo: видимый результат пока не достигнут +### Live AutoDemo: empty frame устранён, но parity ещё не достигнут Read-only `PrintWindow` capture работающего GOG AutoDemo даёт полноценный оригинальный кадр (terrain, варбот и близкая geometry), поэтому теперь есть безвводный source для будущего visual comparison. Текущий полный static-Vulkan -preview нельзя описывать как видимую сцену: хотя он загружает 8 TMA objects, -66 MSH components и 67 descriptors, его изображение состоит только из clear -color. Validation остаётся `0/0`, но это доказывает корректность GPU lifecycle, -а не совпадение с оригинальным renderer. +preview раньше состоял только из clear color. Validation `0/0` тогда доказывал +только GPU lifecycle, но не совпадение с original renderer. Новая CPU-диагностика применяет к тем же source vertices ту же row-major D3D7 matrix, которую GLSL получает как column-major push constant. Для свежего captured Ngi32 camera (`viewport 1024x768`, near `5`, far `700`, FOV `1.3`) -она насчитала `clip_visible_vertices=0`. Следовательно, current empty frame не -объясняется texture selection, face culling (baseline state already disables -it) или Vulkan validation: следующий исследовательский шаг — восстановить -точный live camera transform/clip-space boundary. +она насчитала `clip_visible_vertices=0`. Последующая сверка с +`Ngi32!sub_10009450` и `sub_10007030` нашла два literal translation defects: +Y translation view matrix должна быть `-(m23*m22 + m13*m12 + m03*m02)`, а +projection использует `width/height` и множитель `sin(fov/2)` в обоих depth +coefficients. После исправления того же capture диагностировал +`clip_visible_vertices=938`, а `PrintWindow` native Vulkan window показал +реальную rasterized terrain/model geometry. Это исключает прежний empty-frame +барьер; face culling и texture selection не были его причиной. + +Получившийся кадр всё ещё явно не похож на оригинал: geometry сосредоточена у +границы и material/terrain representation грубая. Значит, следующие задачи — +camera timing/selection, source model-node transforms, terrain material phases, +lighting и visibility, а не объявление pixel parity. Параллельно bridge для legacy-camera path теперь переводит только высоту `Land.msh` в world units с масштабом `1/32`: raw AutoDemo heights |
