DV: Fix multiple LODs showing simultaneously with REPLACE refinement #15
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.
While testing #13 on our dev performance testing project, I noticed that occasionally some models would display more than one LOD like shown in the first video clip. I also show the comparison to the original IFC file in OpenIFCViewer.
There was a slight oversight (by me) when checking if we could merge two
GroupedTilesArray
instances that if enough there was going to be enough space (depending onmaxSize
) then we would just naively concatenate the two arrays. This has an unintended side effect in the platform that if the tile budget isn't quite reached, and there are tiles with a REPLACE refinement strategy that can be added, then the children will be concatenated to the array in addition to the parent tiles.Instead, don't short-circuit the concatenation and ensure we evaluate all tiles when merging so that we can splice out any
REPLACE
parent tiles as needed.Fortunately, it's unlikely many people would have noticed this as it required you to have quite a small amount of data visible so that every tile that satisfied geometric error could be loaded within the total tile budget.
N.B. The diff looks bad, but it's really just whitespace after I removed the if at the beginning.
Before:
Screen.Recording.2024-09-04.at.13.58.17.mov
After:
Screen.Recording.2024-09-04.at.13.58.56.mov