Commit Graph
9 Commits
Author SHA1 Message Date
shenandshen 62a5f5ad11 Fix terminal foliage dispatch on frond branches
Generate authored terminal leaves independently of frond activation, matching the recovered last-level dispatch. This prevents three umbrella-thorn copies from expanding leaf cards into full frond nodes and hitting the node budget.

Add an active-frond regression with 17500 terminal cards and record verification: all 606 resources generate without truncation, SDK and client targeted tests pass, and corpus ASan/UBSan checks pass.
2026-10-12 18:52:02 -07:00
shenandshen 66992b3024 Implement cross-platform SpeedTree runtime and recovery tests
Add bounded SPT parsing, authored branch frames and foliage generation, independent LOD meshes, billboards, collision metadata, and legacy CPU/shader wind support. Restore seeded sampling and special leaf selection with generation diagnostics and reproducible baseline tools.

Include regression coverage and static recovery documentation describing remaining differences from the original runtime. SDK tests pass (4/4); full corpus and client validation are recorded in the recovery notes.
2026-10-12 18:52:02 -07:00
shenleiandClaude Opus 5.5 53115d9ea2 gr2: look up bones by a cached name index
FindBoneIndex builds a name->index map once per instance (first match
wins, as the linear scan did); GetBoneWorldTransform gains an index
overload and attached models cache their bone index at attach time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:38:18 +09:00
shenleiandClaude Opus 5.5 16d16de90d gr2: resolve skins once per skin change on the GPU draw cache
The cached GPU draws keep the skinned texture names and the unskinned
originals; SetSkin/ClearSkins bump a generation so the cache re-resolves
once instead of lowercasing every texture path every frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:30:32 +09:00
shenleiandClaude Opus 5.5 9ec7fa10c0 gr2: share vertex streams across tri-groups on the GPU skinning path
Each tri-group draw now references one shared geometry with a
first_index/index_count sub-range instead of copying the vertex
streams per group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:27:00 +09:00
shenleiandClaude Opus 5.5 e354b92e08 gr2_render: cache part->parent bone map and parent bind pose
BuildDrawCommandsWithPalette recomputed gr2::bind_pose of the parent
skeleton and an O(part bones x parent bones) name match every frame for
every hair/armor part. Both depend only on the two skeletons; rebuild
them when the parent skeleton changes and reuse the palette buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:13:22 +09:00
shenleiandClaude Opus 5.5 a1b3938159 gr2_render: share one GPU skinning palette per instance per frame
Gr2MeshDraw::bone_matrices (a full palette copy per draw, also filled on
the CPU path where nothing reads it) becomes a shared_ptr palette set by
UpdateGpuDraws for gpu_skinning draws only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:12:14 +09:00
shenleiandClaude Opus 5.5 de8fa40098 gr2: align curve sampling with Granny 2.11 (loop window, cubic, degree 0)
- Curve::eval rebuilds the B-spline window like ConstructBSplineBuffers:
  clamped ends repeat the endpoint; underflow/overflow looping takes knots
  from the other end (+-duration, skipping the duplicated last knot); equal
  trailing knots get +1e-5.
- Degree 3 (CubicCoefficients) supported; degrees 0..3 share one path.
- Degree 0 takes the control of the first knot > t (SampleBSpline0 = pi[0]);
  DaKeyframes32f curves are marked keyframed and keep frame trunc(t/dt).
- Loop flags threaded through BoneTrack::sample, Animation::sample_local and
  sample_pose; control_loop_state() mirrors GetControlLoopState.
- Gr2ModelInstance::SetAnimationLoop(); animated attachments (fmod) loop.
- Quaternion continuity stays on for every span (Granny: buffer path only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:39:33 +09:00
shenandshen 86759bb726 Initialize shared Metin2 SDK with rendering optimizations and tests 2026-10-11 17:52:55 -07:00