Skip to content

fix(gl): respect camera near/far in VisGL - #393

Merged
jeffamstutz merged 2 commits into
next_releasefrom
visgl_near_far_fix
Nov 16, 2026
Merged

jeffamstutz merged 2 commits into
next_releasefrom
visgl_near_far_fix

Conversation

@jeffamstutz

Copy link
Copy Markdown
Collaborator

VisGL ignored the ANARI near/far camera parameters and always fit the clip range to the world bounds.

Both the perspective and orthographic cameras now apply the same rule as the RTX device (Camera::commitClipPlanes):

  • unset means no clipping
  • invalid values (perspective: not 0 < near < far; orthographic: not 0 <= near < far) are ignored together with a warning
  • the world-fitted clip range is narrowed to the requested near/far; if the world lies entirely outside it, the requested range is used

Without near, the perspective camera keeps its existing far/1000 depth-precision fallback.

Tested: the VisGL device builds. No rendering tests were run.

Apply the same rule as the RTX device: unset means no clipping, and
invalid values (not 0 < near < far) are ignored with a warning. The
world-fitted clip range is narrowed to the requested near/far.
Same rule as the RTX device (0 <= near < far, invalid values ignored with
a warning), narrowing the world-fitted clip range.
@jeffamstutz

Copy link
Copy Markdown
Collaborator Author

FYI @Eclesia + @progschj

@Eclesia

Eclesia commented Nov 16, 2026

Copy link
Copy Markdown

thanks for the fix. 👍

@Eclesia

Eclesia commented Nov 16, 2026 •

Copy link
Copy Markdown

Confirmation it works correctly.

It's nice to have a working high FPS Anari device now.

Capture d’écran_2026-11-17_00-08-40

@jeffamstutz
jeffamstutz merged commit 51d32f5 into next_release Nov 16, 2026
8 checks passed
@jeffamstutz
jeffamstutz deleted the visgl_near_far_fix branch November 16, 2026 23:13
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.

2 participants