Repository navigation
A prim every LOD builds alike is generated once, and its LOD changes rebuild nothing - #558
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 23, 2026
RyeMutt
force-pushed
the
rye/prim-lod-invariant
branch
from
October 23, 2026 10:56
e3b77e6 to
1428725
Compare
Since a straight path with no twist and no taper takes one quad per profile edge, a square or triangle profile on it, with no hole or a square or triangle one, builds the same geometry at every detail. The split rule LLVolume::generate applies is now profile_split(), and LLVolume::isLODInvariant(params) asks it whether the split is 0 at every detail, then requires equal twist begin and end, a square or triangle profile, a hole that is not round, and no sculpt or mesh. A hole the clamp pulls in to its wall keeps its split points and so varies by LOD; the check lays the profile out once to see it, when a parameter set's LOD group is made, and each volume reads the same answer off its own profile in generate(). A test builds all four LODs of every sweep shape the predicate accepts and holds them byte-identical: positions, normals, UVs, tangents, indices and faces. Every shape it rejects differs at some LOD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LLVolumeLODGroup::refLOD built a volume for each LOD an object asked for, though a box, a prism or a hollow, cut, tapered or sheared box comes out the same at all four. For a shape whose parameters say so, refLOD now hands out one volume, its LOD 3 one, for every LOD. derefLOD already finds a volume by pointer, so the counts stay consistent; a test refs and unrefs in mixed order and checks the group cleans up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When calcLOD moved an object's LOD, updateLOD marked REBUILD_VOLUME before anything asked whether the geometry would change, so a box crossing an LOD threshold refetched its volume, rebuilt its faces and had its spatial group's buffers rebuilt, for geometry that was the same. An LOD-invariant volume now takes the path an unchanged LOD takes: mLOD still moves, for the LOD display, object weights and streaming cost, and nothing is rebuilt. LLPrimitive::setVolume also returns early for an LOD-invariant volume with the same parameters. Without that, a later setVolume at the object's current LOD took the path that hands back the same volume and reported a change. Sculpts, meshes, flexible prims and the unique single-face volume a sculpt unload makes are never LOD-invariant, so their paths are as they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… per frame
Tracy plots, per frame: volumes whose LOD moved ("volume LOD moves"),
those of them marked for a volume rebuild ("volume LOD rebuilds"), the
faces those rebuilds touched ("volume LOD change faces", sNumLODChanges)
and volume spatial groups whose geometry was rebuilt ("volume group
rebuilds"). Two captures of the same camera sweep with equal LOD moves
compare their rebuilds directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RyeMutt
force-pushed
the
rye/prim-lod-invariant
branch
from
October 23, 2026 13:10
1428725 to
5f2c58f
Compare
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.
Now that a straight, untwisted, untapered prim gets one quad per profile edge, a box, a prism, or a hollow, cut, tapered or sheared box builds exactly the same geometry at all four LODs. Today each LOD is still built separately, and an LOD change still rebuilds the volume and its spatial group's buffers. With this PR, such a shape is built once, and its LOD changes rebuild nothing.
This is part 3 of a stack of 7. Merge them in order: each PR is based on the one before it and shows only its own commits.
Changes
LLVolume::isLODInvariant(params): answers from the parameters whether every LOD builds the shape alike. The split rulegenerateapplies is nowprofile_split(), so the check and the generator can't drift apart.LLVolumeLODGroup::refLOD: hands out one volume, the LOD 3 one, for every LOD of an invariant shape.derefLODalready finds a volume by pointer, so the counts stay consistent.LLVOVolume::updateLOD: an invariant volume now takes the path of an LOD that didn't change.mLODstill moves, for the LOD display, object weights and streaming cost, but nothing is refetched or rebuilt.LLPrimitive::setVolumealso returns early for the same invariant parameters, so that a latersetVolumedoesn't report a change.Tracy plots, per frame:
Two captures of the same camera sweep can compare rebuilds directly.
Testing
llmath_tests, shuffled: 411 cases. 410 pass and 1 is skipped.llprimitive_tests: all 48 cases pass.🤖 Generated with Claude Code