Files
CydandClaude Fable 5 afc3fd839e Vendor dpl3-revive: the Division/DPL3 renderer, now ours
Bring the graphics-dev collaborator's dpl3-revive into the repo as first-class
project code (they've handed it off; it's ours now). This is the proven
Division renderer that our in-process rt_draw has been trying to be.

What's here:
- parser/  B2Z/V2Z/SVT/SCN/SPL/BGF/BMF/BSL decoders (pure Python).
- spec/    reverse-engineered format + the definitive VelociRender wire
           protocol (from the original DIVISION source, matches our live
           VPX node/action tables exactly).
- source-ref/  read-only copies of the original DIVISION C (BIZREAD.C,
           DPLTYPES.H, DPL.H) that define the formats.
- patha/   the "virtual VelociRender board": vrboard.py (24-action protocol
           server), vrview.py (numpy software rasterizer, the reference),
           vrview_gl.py (moderngl GPU backend, 832x512@60Hz), plus the
           run/replay/regress tooling and evidence renders. Drives FLYK/BLADE/
           Star Trek demos AND our btl4opt/rpl4opt game binaries.
- viewer/  WebGL archive generators (.py); prebuilt HTML/data regeneratable.
- samples/ small test models/textures.
- bt*.raw.bin  real BTL4OPT arena wire captures (kept for offline renderer
           testing/regression against OUR game).

.gitignore keeps the multi-hundred-MB demo capture dumps + debug logs +
regeneratable viewer bundles out of history (they stay on disk).

Phase 0 of the integration is validated: their board decodes our bt8 capture
with zero errors (3748 nodes, 507 instances, 4 mechs) and renders our arena
(terrain/dome/sky, correct Division DAC gamma). Plan + status in memory;
integration continues in emulator/RENDERER-COLLAB.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 22:06:25 -05:00

40 lines
1.6 KiB
Python

#!/usr/bin/env python3
"""
hybrid_render.py -- Path A rendering (hybrid): render the scene FLYK.EXE is running,
from an in-scene camera, using the dpl3-revive pipeline.
FLYK streams the scene GRAPH (camera projection, DCS transforms, instance placements,
materials) over the VelociRender link, and animates it per-frame via action 0x1d
(decoded by analyze_scene.py). The GEOMETRY is referenced by name and loaded from files
-- exactly what dpl3-revive already parses. So we assemble the scene from files and view
it from the camera FLYK uses (a diver inside the reef), producing the picture FLYK's dead
i860 board would have drawn.
python hybrid_render.py [showcase_index] [out.png]
Default: SHARKS.SCN (the Hull-Pressure aquarium reef), interior camera on the shark.
"""
import sys, os
HERE = os.path.dirname(os.path.abspath(__file__))
VIEWER = os.path.join(os.path.dirname(HERE), "viewer")
sys.path.insert(0, VIEWER)
sys.path.insert(0, os.path.join(os.path.dirname(HERE), "parser"))
import bundle, render_preview
# Interior cameras (eye, center, up) framing the animated content of each showcase scene.
# For SHARKS the fish/sharks cluster near (-220, 225, -350) -- matches FLYK's live 0x1d
# translations (y~230, z~-200), confirming the camera looks where FLYK animates.
CAMS = {
2: {"eye": [450, 300, 250], "center": [-220, 225, -350], "up": [0, 1, 0]}, # SHARKS
}
def main():
idx = int(sys.argv[1]) if len(sys.argv) > 1 else 2
out = sys.argv[2] if len(sys.argv) > 2 else os.path.join(HERE, "flyk_render.png")
md = bundle.build_model(bundle.SHOWCASE[idx])
render_preview.render(md, out, cam=CAMS.get(idx))
if __name__ == "__main__":
main()