mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-24 22:09:10 -06:00
Fix for property change interpolation during playback with screenshots
This commit is contained in:
@@ -645,6 +645,7 @@ protected:
|
||||
std::chrono::steady_clock::duration _saveRenderingDeltaTime_interpolation_usec;
|
||||
std::chrono::steady_clock::time_point _saveRenderingCurrentRecordedTime_interpolation;
|
||||
long long _saveRenderingClockInterpolation_countsPerSec;
|
||||
bool _saveRendering_isFirstFrame = true;
|
||||
|
||||
unsigned char _keyframeBuffer[_saveBufferMaxSize_bytes];
|
||||
|
||||
|
||||
@@ -333,6 +333,7 @@ bool SessionRecording::startPlayback(std::string& filename,
|
||||
_saveRenderingCurrentRecordedTime_interpolation = steady_clock::now();
|
||||
_saveRenderingClockInterpolation_countsPerSec =
|
||||
system_clock::duration::period::den / system_clock::duration::period::num;
|
||||
_saveRendering_isFirstFrame = true;
|
||||
|
||||
//Set playback flags to true for all modes
|
||||
_playbackActive_camera = true;
|
||||
@@ -457,6 +458,7 @@ void SessionRecording::cleanUpPlayback() {
|
||||
_idxTimeline_cameraPtrPrev = 0;
|
||||
_hasHitEndOfCameraKeyframes = false;
|
||||
_saveRenderingDuringPlayback = false;
|
||||
_saveRendering_isFirstFrame = true;
|
||||
|
||||
_cleanupNeeded = false;
|
||||
}
|
||||
@@ -1403,6 +1405,12 @@ void SessionRecording::moveAheadInTime() {
|
||||
double currTime = currentTime();
|
||||
lookForNonCameraKeyframesThatHaveComeDue(currTime);
|
||||
updateCameraWithOrWithoutNewKeyframes(currTime);
|
||||
//Unfortunately the first frame is sometimes rendered because globebrowsing reports
|
||||
// that all chunks are rendered when they apparently are not.
|
||||
if (_saveRendering_isFirstFrame) {
|
||||
_saveRendering_isFirstFrame = false;
|
||||
return;
|
||||
}
|
||||
if (isSavingFramesDuringPlayback()) {
|
||||
// Check if renderable in focus is still resolving tile loading
|
||||
// do not adjust time while we are doing this, or take screenshot
|
||||
|
||||
@@ -513,7 +513,7 @@ void Scene::addPropertyInterpolation(properties::Property* prop, float durationS
|
||||
|
||||
PropertyInterpolationInfo i = {
|
||||
prop,
|
||||
std::chrono::steady_clock::now(),
|
||||
now,
|
||||
durationSeconds,
|
||||
func
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user