[FEATURE] Per-frame visual vertex deformation for KinematicEntity#2768
Closed
Kashu7100 wants to merge 3 commits into
Closed
[FEATURE] Per-frame visual vertex deformation for KinematicEntity#2768Kashu7100 wants to merge 3 commits into
Kashu7100 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7dfd584f8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Adds ``KinematicEntity.set_vverts(vverts, envs_idx=None)`` so externally- skinned meshes (e.g. SMPL body models, deforming objects) can drive visual vertex positions without going through the per-vgeom transform path. The rasterizer grows a per-env "skinned" node path: when an entity has ``has_custom_vverts`` set, each rendered env gets its own pyrender node and ``_update_rigid_custom_vverts`` blits the user vertex buffer into the node's GL buffers (positions and recomputed normals) per frame. The instanced rigid_node is lazily migrated on first use. Mesh topology is unchanged; only vertex positions move per frame, so the rasterizer's vertex-reorder cache hit path stays valid. Includes ``examples/rendering/custom_visual_mesh.py`` with two demos: - A wave-deforming subdivided box (no external dependencies) - A SMPL body model driven via ``smplx`` (optional dependency) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When an entity rendered in collision or sdf mode also has set_vverts called on it, the custom-vverts branch took over and continue'd, freezing the collision/sdf nodes at their initial pose. set_vverts only writes the visual mesh, so the early-out should be conditional on vis_mode=='visual'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6a1022f to
86c956d
Compare
86c956d to
ea7b110
Compare
Collaborator
|
it turns out the split is a bad idea. Let's close this and merge with #2769. |
2 tasks
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.
Summary
Adds
KinematicEntity.set_vverts(vverts, envs_idx=None)so externally-skinned meshes (e.g. SMPL body models, deforming objects) can drive visual vertex positions per frame without going through the per-vgeom transform path.The rasterizer grows a per-env "skinned" node path: when an entity has
has_custom_vvertsset, each rendered env gets its own pyrender node and_update_rigid_custom_vvertsblits the user vertex buffer into the node's GL buffers (positions and recomputed normals) per frame. The instancedrigid_nodeis lazily migrated on first use, so paying the per-env cost is opt-in viaset_vverts.Mesh topology is unchanged; only vertex positions move per frame, so the rasterizer's vertex-reorder cache hit path stays valid.
Files changed
genesis/engine/entities/rigid_entity/rigid_entity.py—_custom_vvertsbuffer,has_custom_vvertsproperty,set_vverts(vverts, envs_idx=None)API.genesis/vis/rasterizer_context.py— per-envskinned_nodesdict,add_skinned_node,_update_rigid_custom_vverts,_seg_key_for_geomhelper extracted for reuse, lazy migration from instanced rigid node.examples/rendering/custom_visual_mesh.py— wave-deforming subdivided box (no external deps) and SMPL body model demo (requiressmplx).Relationship to the previous PR
This PR is the rendering half of #2721. The other half — visual-mesh raycasting (depth camera / lidar against
KinematicEntity) — is split into a separate dependent PR.Test plan
python examples/rendering/custom_visual_mesh.py -vrenders a wave-deforming box that visibly deforms each framepython examples/rendering/custom_visual_mesh.py -v -B 4renders 4 batched envs each with their own deformation phasepython examples/rendering/custom_visual_mesh.py -v --smpl --model_path <path>renders an animated SMPL bodyset_vverts🤖 Generated with Claude Code