Skip to content

Compute animated Item Display poses directly - #42

Merged
WilyFoxM merged 1 commit into
mainfrom
feat/live-pose-fast-path
Nov 5, 2026
Merged

WilyFoxM merged 1 commit into
mainfrom
feat/live-pose-fast-path

Conversation

@WilyFoxM

@WilyFoxM WilyFoxM commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Problem and resulting behavior

About two thirds of Live geometry parts on a ModelEngine spawn are interpolating. Each of them ran the whole vanilla submit every frame just to get its pose: the largest single cost of Live capture.

  • New option Fast poses for animated displays on the Rendering page, ON by default. When only the interpolated transform or the billboard changed, the pose is computed directly: vanilla's orientation (through an accessor, not a copy) times vanilla's interpolated Transformation, times a rest matrix learned from the last vanilla pose.
  • A part gets the direct path only after its learned rest predicted the next vanilla pose, normals included, within a small tolerance. A part that fails, or whose pose cannot be inverted, stays on the ordinary path for as long as it is tracked. Changed display data always goes through vanilla.
  • live_poses benchmark target in the add-on, and poseFast, poseRejected, poseChecks and poseMismatches in the Live geometry diagnostic.

Validation performed

  • GitHub checks (build, unit-tests, spotless): pending on this PR.
  • Local checks actually run (configuration and result):
    • ./gradlew spotlessApply build (JDK 25.0.4): passes, with 43 local JUnit tests. English and Russian translation key sets are equal.
    • 14 fixtures covering the change, quick mode, standalone, Sodium + ImmediatelyFast and Sodium + Iris 1.11.4 with shaders off: all pass. LivePoseFastClientTest (new), LiveViewCullingClientTest, LiveDisplaySceneClientTest, LiveExtractionSceneClientTest, StaticDisplaySceneClientTest, TextAndLiveSceneClientTest, FeatureBatchLiveClientTest, DrawLessSettingsClientTest, DisplayProbeClientTest, BenchmarkSeriesClientTest, ItemMeshEvictionClientTest, PlayerArmorClientTest, PlayerItemClientTest, IrisShaderPackClientTest.
    • LivePoseFastClientTest: 16 animated displays with every billboard mode, entity rotation, negative scale, item transforms and one riding another entity. A test-only mode compares the predicted pose with vanilla's on every frame: 960 to 2864 comparisons per run, no mismatch. With the option on, all 16 take the direct path, and the final frame matches a fresh vanilla capture pixel for pixel.
    • LiveDisplaySceneClientTest now accepts either the vanilla or the direct path for its interpolating display.
    • The full native suite was not run; it is reserved for releases.
  • Rendering screenshots / benchmark evidence, where relevant: one field series, 3 OFF/ON pairs, on a live server spawn with ModelEngine NPCs, Sodium, view skipping on, FOV 110, no other players, stationary camera. This was the prototype with the option toggled by the series and OFF by default; I didn't repeat it after making it the default.
Sampled frames OFF ON
Live local pose 0.124 ms 0.064 ms
Live capture 0.223 ms 0.168 ms
Vanilla submissions per frame 94.6 8.8
Direct poses per frame 0 80.2
Parts rejected 0 0

The series measured +0.99, +6.23 and +5.40% (mean +4.20%), but the OFF phases varied by 7.96%, so the FPS figure is not reliable. From the saved work, about 0.055 ms of a 3.3 ms frame, I'd expect about 2%. I looked at animated NPCs up close with the option on and didn't notice anything unusual; that is an observation, not pixel parity.

Limits and compatibility

One scene and one session; GPU time not measured; crowded scenes not measured. Pixel comparison uses simple models, while the field run covered real multi-part models only through the pose check. The rest matrices add one Matrix4f per tracked instance. With an Iris shader pack active, Live geometry is paused, so this path is unused.

Interpolating parts get their pose from vanilla's orientation and
interpolated transform times a rest learned from the last vanilla pose,
instead of a full vanilla submit every frame. A part takes this path
only after its rest predicted a vanilla pose; others keep the ordinary
path. A new setting controls it, ON by default.
@WilyFoxM
WilyFoxM merged commit 107e284 into main Nov 5, 2026
6 checks passed
@WilyFoxM
WilyFoxM deleted the feat/live-pose-fast-path branch November 5, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant