Skip to content

#13930 Viewer: Guard against empty frustum in per-model culling#13931

Merged
magnesj merged 1 commit intoOPM:devfrom
magnesj:13930-frustum-culling-guard
Apr 30, 2026
Merged

#13930 Viewer: Guard against empty frustum in per-model culling#13931
magnesj merged 1 commit intoOPM:devfrom
magnesj:13930-frustum-culling-guard

Conversation

@magnesj
Copy link
Copy Markdown
Member

@magnesj magnesj commented Apr 30, 2026

Summary

  • Fixes Crash when calculating near/far planes #13930 — assertion crash in cvf::Frustum::isOutside when opening a project.
  • Camera::computeViewFrustum() returns an empty Frustum if the projection matrix is degenerate (e.g., on the first paint after project open, before a valid near/far has been set). The per-model culling introduced by 82c7172 calls Frustum::isOutside() unconditionally, which asserts when the frustum has fewer than 6 planes.
  • Skip culling when the frustum is not fully populated; all valid models then contribute to the near/far calculation, matching the pre-82c7172c1 behaviour.

See #13930 for full root-cause analysis.

Camera::computeViewFrustum() returns an empty Frustum if the projection
matrix is degenerate (e.g., on the first paint after project open, before
a valid near/far has been set). The per-model culling introduced by
82c7172 calls Frustum::isOutside() unconditionally, which asserts when
the frustum has fewer than 6 planes. Skip culling when the frustum is
not fully populated; all valid models then contribute to the near/far
calculation, matching the pre-82c7172c1 behaviour.
@magnesj magnesj requested a review from jonjenssen April 30, 2026 13:16
@magnesj magnesj merged commit 5239a4d into OPM:dev Apr 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when calculating near/far planes

2 participants