Files
Neutron/docs/rendering.md
T

90 lines
5.3 KiB
Markdown

# Current Vulkan rendering and evidence
Original API and state maps: `analysis/graphics.md`. Mesh/material/texture formats:
`file-formats.md`. Vulkan code: `src/GamePort/Rendering/Vulkan/VulkanRenderer.cs`.
Default prepared LV1B view uses the GAM STARTEXP camera; positive-Z projection
uses recovered FOV `0xAAA/16384*360` degrees, near 20, far 10000. Generic engine
far default is 3200; other scene-specific overrides remain to be mapped. Camera
target offset (0,80,0) is recovered, but startup look-at and follow interpolation
have not been dynamically compared. Vulkan viewport Y is handled in projection.
World OMT coordinates and per-corner UVs are unchanged. ASE conversion (x,z,y)
and (u,-v) is verified using duplicate gate/yokianpart assets; no invented light
is applied to Jimmy. The original normal texture is jimycarl.png (InitObject
0x422C96), while jimyshock.png is texture slot 1, a separate effect (0x422CA7).
The normal atlas and scene/player captures have been visually inspected locally.
## Null-material visibility correction
LV1B references material 18 from 45 draw ranges but that material does not exist
in its original resource index. Names include phoneblock, blockfan and Box/Plane
objects. Rendering them with white fallback surfaces incorrectly obscured the
actual lab. Disassembly of OMT2.dll DX draw_shape at `0x1003756C` loads the
polygon material pointer, tests it at `0x1003756F`, and jumps directly to polygon
advance at `0x10037A7F` when null. Therefore the modern scene loader retains this
geometry but excludes unresolved-material draw ranges, matching the original
render path. It does not assign collision semantics solely from names.
The original also tests in-memory polygon flag 4 (0x10037577). For v2 resources,
the first serialized bool sets flag 2 at 0x10003F83 (DX disables culling for that
bit at 0x10037731); the second bool sets flag 1 at 0x10003F9B. Other legacy
fields and per-material pipeline states still need full mapping.
## Animation preview
MorphAnimation reads prepared base topology/UV and sample vertex positions, with
linear interpolation following DLL 0x10002F9A. It can append a player draw with
independent texture to original scene geometry and updates the mapped coherent
vertex buffer after synchronous frame completion. Source frame sample timing is
used for preview. Loop closure, state selection, state-specific playback speed,
normal interpolation, clothing variants and gameplay pose transforms remain
unverified. This is not a complete animation/gameplay reconstruction.
GPU readback evidence: `artifacts/test-level1b.ppm`, `artifacts/test-player.ppm`,
`artifacts/jimmy-normal.ppm`, `artifacts/resize-input.ppm` (generated/ignored).
No original reference image equivalence or pixel-perfect claim is made.
## Standing preview floor overlap and static idle
User report: Windows displays Jimmy partly inside the floor and no apparent motion.
The default jimstop source samples (TIMEVALUE0/480) contain identical vertex
positions. The earlier description of an animated default was incorrect. They
remain a still idle pose; explicit keys1/2/3/4 select idle/run/jump/scratch previews,
with clip identity and controls shown in the SDL window title. Playback is an
inspection feature; movement/controller/state-machine gameplay is still missing.
The original standing base minimum Y is -64.6165. Simply adding GAM STARTEXP Y
26.6619 puts the lowest soles at -37.9546, below the visible lab floor near0.5486.
The previous screenshot review missed that intersection. PreviewCharacterPlacement
now derives one upward model-only offset from standing-base vertices and visible
floor triangles beneath the original root. It excludes overhead/steep surfaces and
unrendered proxies. The original GAM root, raw ASE vertices, scale, camera and
animation deformation remain unchanged. The resulting LV1B correction is +38.503Y.
This is a documented preview placement policy pending original actor transform and
collision settling recovery; it is not evidence that the original game uses it.
It is computed once from the standing base, so animated jumps are not resnapped
to the floor on every frame.
C# regressions cover the actual lab, flat-floor contact, ceilings, excluded proxy
draws, missing floors and clip selection. Native GPU run captures at0 and0.1 seconds
differ; a seven-frame automatic advance matches the fixed0.1-second capture byte
for byte. SDL6-frame smoke switches to Run cycle by injected key2 and resizes,
with zero validation errors. Generated evidence: artifacts/placement-*.ppm and
placement-tests.log. Native Windows user retesting of this update remains pending.
Read-only original-DLL probe: tools/binary/omt_shape_probe.c, built with local
i686-w64-mingw32-gcc, calls the supplied OMT ASE converter in a copied installation
inside the reference sandbox. In non-animation conversion mode0 it emits426
vertices and identical base coordinate bounds, confirming the raw data diagnosis
for that mode. The game uses conversion mode2, so the probe does not establish
the original actor origin/scale. Reproduce:
```sh
i686-w64-mingw32-gcc -O0 tools/binary/omt_shape_probe.c -o artifacts/binary/omt_shape_probe.exe -static-libgcc
python3 tools/recon/reference_capture.py --asset-probe --seconds 12
```
Output is under artifacts/asset-probe; no original directory is mounted/writable
in the probe namespace. The converter operates only on copied bytes/in-memory objects.