-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera clipping terrain fix #3750
Conversation
|
||
// Camera vectors may not be orthonormal when the camera clamps to the terrain | ||
// so apply inverse instead of inverseTransformation | ||
Matrix4.inverse(camera._viewMatrix, camera._invViewMatrix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just a band-aid? Should we apply Gram–Schmidt orthonormalization earlier so the matrix is orthonormal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes just a band-aid right now. I'll try to fix the main problem before this is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine the shadows branch, but are you sure you want to put this in master now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lilleyse what do you think? Should we close this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll close this and submit an issue instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or.. just keep the fog issue open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave the fog issue open.
Fixes #3178.
Also fixes the atmosphere flickering that happens when the camera is swiveled into the ground.
This fix doesn't really solve the underlying problem.
ScreenSpaceCameraController.adjustHeightForTerrain
generates non-orthonormal view vectors which causesinverseTransformation
to not work as expected. I'm not completely sure how to fix that, but this is a quick fix that works at a slight computation cost.