-
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
Treat frustum changes as camera changes in Scene#render #6821
Changes from all commits
c3bb2be
c7a1b0c
3fa9b0e
f626f31
a041bbf
0b00e1a
198cd4d
3f08132
b7c1e30
564ef27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1488,7 +1488,8 @@ define([ | |
Cartesian3.equalsEpsilon(camera0.direction, camera1.direction, epsilon) && | ||
Cartesian3.equalsEpsilon(camera0.up, camera1.up, epsilon) && | ||
Cartesian3.equalsEpsilon(camera0.right, camera1.right, epsilon) && | ||
Matrix4.equalsEpsilon(camera0.transform, camera1.transform, epsilon); | ||
Matrix4.equalsEpsilon(camera0.transform, camera1.transform, epsilon) && | ||
camera0.frustum.equalsEpsilon(camera1.frustum, epsilon); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add (or modify) a test to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm having trouble getting the test to fail on master. I'll try again tomorrow but do you have any tips / ideas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Take a look at the other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, the newest commit has a test that failed before and passes with these changes. |
||
} | ||
|
||
function updateDerivedCommands(scene, command) { | ||
|
@@ -3172,13 +3173,17 @@ define([ | |
|
||
function checkForCameraUpdates(scene) { | ||
var camera = scene._camera; | ||
if (!cameraEqual(camera, scene._cameraClone, CesiumMath.EPSILON15)) { | ||
var cameraClone = scene._cameraClone; | ||
|
||
scene._frustumChanged = !camera.frustum.equals(cameraClone.frustum); | ||
|
||
if (!cameraEqual(camera, cameraClone, CesiumMath.EPSILON15)) { | ||
if (!scene._cameraStartFired) { | ||
camera.moveStart.raiseEvent(); | ||
scene._cameraStartFired = true; | ||
} | ||
scene._cameraMovedTime = getTimestamp(); | ||
Camera.clone(camera, scene._cameraClone); | ||
Camera.clone(camera, cameraClone); | ||
|
||
return true; | ||
} | ||
|
@@ -3310,10 +3315,8 @@ define([ | |
tryAndCatchError(this, time, update); | ||
this._postUpdate.raiseEvent(this, time); | ||
|
||
this._frustumChanged = !this._camera.frustum.equals(this._cameraClone.frustum); | ||
|
||
var cameraChanged = checkForCameraUpdates(this); | ||
var shouldRender = !this.requestRenderMode || this._renderRequested || cameraChanged || this._frustumChanged || this._logDepthBufferDirty || (this.mode === SceneMode.MORPHING); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the only place There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used on Line 1513. It didn't look like cameraChanged (or something like it) could be a drop-in replacement so I didn't change it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's fine to leave. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha |
||
var shouldRender = !this.requestRenderMode || this._renderRequested || cameraChanged || this._logDepthBufferDirty || (this.mode === SceneMode.MORPHING); | ||
if (!shouldRender && defined(this.maximumRenderTimeChange) && defined(this._lastRenderTime)) { | ||
var difference = Math.abs(JulianDate.secondsDifference(this._lastRenderTime, time)); | ||
shouldRender = shouldRender || difference > this.maximumRenderTimeChange; | ||
|
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.
@bagnell Does it make sense to use the same epsilon for all these values?