Repository navigation
A posed skinned model is added and removed in place - #183
Merged
Merged
Conversation
…hored tangent follows its joints Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A new shared pose sent every triangle of its mesh: 180 bytes each, skinned on the CPU. Now the CPU sends the pose's matrices and a compute pass skins the mesh from its model's corners: triangles, shading attributes, BLAS input. The CPU keeps no triangles of such a pose; a click or a query skins the mesh when it asks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Models in the same pose shared one mesh, and one of them taking another pose rebuilt the scene. Now a model's mesh is its own, skinned by the pass at each new pose: another clip or time is in place whatever the others do, and the model is hidden and shown in place by its instance. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A posed model the scene did not call movable was moved by skinning it again where it stands. One that is an instance of a deforming mesh was not moved at all: no pose had changed, and nothing rebuilt. Its move is recorded as a move now; the renderer moves an instance and skins world-space triangles again. The test's fixture: 72 triangles (two blocks of the pass), a joint turned about an axis that is neither the normals' nor the tangents', a node that mirrors its mesh, a clip that turns it back. The test: two model files in two poses (two sources, two jobs), a model moved alone, posed and moved at once, after the scene's buffers grew, and a pose that mirrors other primitives. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A mesh's triangles were in its model's order, and first in the GPU's, in every scene the tests had: corners left in the model's order, and a job counted from the pool's start, passed. The fixture's materials now go light, grey, light, and the scene has a rect light's card before the meshes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts: # renderer/src/live/inplace_tests.rs
…e rebuild Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts: # docs/ROADMAP.md # renderer/src/gpu.rs # renderer/src/live/edits.rs # renderer/src/live/mod.rs # renderer/src/scene.rs
Its instance is cleared above the triangles and is no object's; its mesh's triangles and its skinning job stay until the next rebuild, as the build's do. Under software traversal, where it has no instance, a rebuild. What a batch changed of an object (a pose, a move, its visibility) goes with it when the same batch removes it: the renderer found nothing to pose and rebuilt. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts: # renderer/src/live/inplace_tests.rs
The kernel found them by the triangle's place among the dynamic triangles, which a mesh placed by an edit does not have. An instance of a mesh that deforms now says where they are (its record's n2.w), and the first hit's motion reads there. The build puts them where they were. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
One of a model the scene has: a mesh of its own in the room, skinned on the CPU once for the pose it comes in, its previous frame's vertices its own, a job of the skinning pass, which skins it from its next pose on. The pass's table and the previous vertices' buffer grow with it. One an edit placed gives all of it back when it is removed, and the next one placed takes it. A rebuild's still: a skinned model the scene has not, one in a pose that mirrors other primitives than the scene's, and any under software traversal. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A movable card before the meshes (the build's place of a mesh's previous vertices), a bound on every motion vector (a kernel that reads another triangle's previous vertices agrees with a build that does too), a commit that grows the skinning pass's buffers alone, previous vertices kept mesh by mesh across commits with no frame between, and under software traversal a scene with room for triangles. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e of its own In every kernel it cost a scene without such a mesh 0.6 % of its GPU frame (a flight over a city, five alternated pairs of five). F_DEFORM is a scene with a mesh that deforms; elsewhere the read is as it was. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
yujiaxu-ops
marked this pull request as ready for review
November 21, 2026 15:07
The rooms for edits do not grow in a scene with particle systems, and a skinned model added needs room for its previous vertices: a rebuild there, said so in the roadmap. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A character that comes or goes while the game runs rebuilt the scene. Now a posed skinned model of a model the scene has is added in place, and any is removed in place.
F_DEFORM: a scene with a mesh that deforms); no loop is added. In every kernel the read cost a scene without such a mesh 0.6 % of its GPU frame (a flight over a city, five alternated pairs of five).A fault found on the way: what a batch changed of an object (a pose, a move, its visibility) stayed when the same batch removed it, and the renderer rebuilt for an object it could not find. It goes with the object now.
Still a rebuild: a skinned model the scene has not (its materials and textures load with one), one whose pose mirrors other primitives than the scene's, one added hidden and shown later, one added in a scene with particle systems (the rooms for edits do not grow there, for any edit), and any under software traversal.
Measured
Hardware traversal, a game that spawns a character every half second and takes the oldest away (twelve at most), 16 s:
The frame between is the same: with eight spawned and then none, at 1280 x 720, the GPU's frame is 10.6 ms either way (the trace 3.5, the BLAS builds 0.58), the builds in turn after a run thrown away.
GPU time a frame at 1080p on twelve scenes, two alternated pairs against main after a run thrown away: all within 0.7 % (the crowd 0.0 and 0.0). The flight over a city in eleven pairs, since it was the one the read cost before the feature: -0.01 % on average (single pairs between -0.8 and +1.0 %). The quality figures against the offline references are main's.
Checks
🤖 Generated with Claude Code
Note
High Risk
Touches live GPU scene editing, skinning jobs, motion-vector shaders, and instance records—core rendering path with large benchmark gains but subtle correctness risk around buffer reuse and
prev_vertsindexing.Overview
Spawn/despawn characters at runtime without full scene rebuilds. Posed skinned models of assets already in the scene can be added in place (dedicated edit-room mesh, one-time CPU skin for initial pose, GPU skinning job from shared corner data) and removed in place (triangles, records,
prev_vertsslot, and skin job returned to pools for reuse).Motion vectors for edit-placed deforming meshes no longer assume previous vertices live in the dynamic-triangle tail. Each instance carries a
previndex (also in the GPU record); the path tracer gates the extra lookup behindF_DEFORMwhen any mesh deforms, avoiding ~0.6% GPU cost on scenes without deformation.The skinning pass gains
SkinGpu::set_jobwith growable tables/palettes/blocks. Live edits trackprevholes andfree_skinnedslots;keep_prev_spanscopies prior-frame vertices per mesh before re-skin.Placed::Skinnedwires placement/removal through the edit path.Fix: removing an object in the same batch now drops co-pending pose/move/visibility changes so the renderer does not rebuild hunting a missing object.
Still requires rebuild: new model assets, mismatched mirror poses, software traversal, particle scenes without edit-room growth, hidden-then-shown adds, etc.
Reviewed by Cursor Bugbot for commit fd86e92. Bugbot is set up for automated code reviews on this repo. Configure here.