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.
Description
In the original camera3d pr I changed near/far to be multiplied by
norm(eyeposition - lookat)
and set the default far to be very large to avoid clipping issues. This is problematic for OIT where depth is used to mix colors because without zooming plots occupy a very small depth range.To summarize the issues with clipping:
near
value will eventually become large relative to the limits one looks at. This will cause data to be clipped starting from the camerafar
value will eventually clip the far side of the plot. This usually starts with the axis frame/grid disappearingThis pr makes static near/far values available again and adds a new (default) scaling mode which scales
far
so thatfar = 1
always ends up behind the scene bounding sphere, and calculatesnear
to be just in front of it, but no closer thannorm(lookat - eyeposition) * near
(to avoid negative near). This continues to solve the clipping issues asnear
effectively scales with zooming,far
is always outside/behind the region containing data, and it should improve OIT again by keeping the depth scale close to the minimum necessary.Camera setup from the OIT refimg test (scene area not matched exactly)
Code
For reference, this is from master:
And this from beta-20:
Type of change