Faster Preview View (#15884)

Co-authored-by: Kris Austin <kris.austin@gmail.com>
This commit is contained in:
Ian Bassi
2026-10-02 14:45:58 -03:00
committed by GitHub
co-authored by Kris Austin
parent 4ffba13210
commit 70bc02467b
37 changed files with 1740 additions and 290 deletions
+10 -1
View File
@@ -1127,8 +1127,17 @@ GLVolumeWithIdAndZList volumes_to_render(const GLVolumePtrs& volumes, GLVolumeCo
);
}
else if (type == GLVolumeCollection::ERenderType::Opaque && list.size() > 1) {
// Orca: nearest first after the selected ones, so the depth test skips shading hidden surfaces.
for (GLVolumeWithIdAndZ& volume : list) {
volume.second.second = volume.first->transformed_bounding_box().transformed(view_matrix).max(2);
}
std::sort(list.begin(), list.end(),
[](const GLVolumeWithIdAndZ& v1, const GLVolumeWithIdAndZ& v2) -> bool { return v1.first->selected && !v2.first->selected; }
[](const GLVolumeWithIdAndZ& v1, const GLVolumeWithIdAndZ& v2) -> bool {
if (v1.first->selected != v2.first->selected)
return v1.first->selected;
return v1.second.second > v2.second.second;
}
);
}