forked from 1b-agent/opencadstudio-upstream
perf(scene): pixel-size LOD cull at zoom-out
Frustum culling only helps at zoom-in (offscreen geometry); zoom-out
still tessellated and uploaded every wire even when an entire entity
projected to a single pixel. Now we also drop wires whose world AABB
projects smaller than 0.5px in the active view — a fit-all view of a
city plan skips sub-pixel symbols, lines, and curves before they ever
hit the GPU.
- `Scene` captures `world_per_pixel` each render from camera ortho_size
/ widget height.
- `expand_insert` / `tessellate_entity` take an optional
`world_per_pixel`; per-LocalWire / per-nested / whole-Insert /
top-level entity AABB → pixel-size test → skip if < MIN_PIXEL_SIZE.
- One-off paths (hit-test, viewport pane) pass `None` so they still
see full geometry regardless of zoom.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
0996b75bdd
commit
c5ed83c752
3 files changed
+133
-36
No files matched your search
@@ -321,6 +321,7 @@ impl Scene {
|
||||
// a correct culling rectangle before entity_wires_arc() runs.
|
||||
if bounds.height > 0.0 {
|
||||
self.set_render_aspect(bounds.width / bounds.height);
|
||||
self.set_render_pixel_scale(bounds.width, bounds.height);
|
||||
}
|
||||
|
||||
let entity_arc = self.entity_wires_arc();
|
||||
|
||||
Reference in new issue
Block a user