Feature/offline rendering (#906)

* Added functionality of saving out screenshots (with fixed FPS) from a recorded session during playback.
 * Test of feature to request if all data is ready to be rendered, primary used in GlobeBrowsing. Need to go over how chunkTiles are set to OK (some are never OK..).
 * Estimated having working request of checking if chunks with correct level have their color and height data loaded and ready to be rendered. Will re-enable frames saving and try making a movie.
 * Created adaptive LOD factor based on available/unavailable tile data (such that we don't run a lot of iterations with asking for a pile of data that does not fit in the tile cache).
 * Made it able to specify tile cache size in configurastion file. Renamed other Cache value to WMSCache, as we have the TileCache as well.
 * Fix for when focus node has nor renderable, when checking for if dersired data has been loaded. Should probably check all renderable/planets anyway, not just a focus object.
This commit is contained in:
Alexander Bock
2019-06-18 10:15:35 +02:00
committed by GitHub
parent 12d892e95a
commit 8f6520ea8f
16 changed files with 365 additions and 109 deletions
@@ -65,6 +65,16 @@ public:
*/
void preSynchronization();
/**
* Current time based on playback mode
*/
double currentTime() const;
/**
* Fixed delta time set by user for use during saving of frame during playback mode
*/
double fixedDeltaTimeDuringFrameOutput() const;
/**
* Starts a recording session, which will save data to the provided filename
* according to the data format specified, and will continue until recording is
@@ -72,7 +82,7 @@ public:
*
* \param filename file saved with recorded keyframes.
*
* \return \c true if recording to file starts without errors
* \returns true if recording to file starts without errors.
*/
bool startRecording(const std::string& filename);
@@ -119,13 +129,28 @@ public:
*/
void stopPlayback();
/**
* Enables that rendered frames should be saved during playback
* \param fps Number of frames per second.
*/
void enableTakeScreenShotDuringPlayback(int fps);
/**
* Used to disable that renderings are saved during playback
*/
void disableTakeScreenShotDuringPlayback();
/**
* Used to check if a session playback is in progress.
*
* \return \c true if playback is in progress
* \returns true if playback is in progress.
*/
bool isPlayingBack() const;
/**
* Is saving frames during playback
*/
bool isSavingFramesDuringPlayback() const;
/**
* Used to obtain the state of idle/recording/playback.
*
@@ -205,7 +230,6 @@ private:
double appropriateTimestamp(double timeOs, double timeRec, double timeSim);
double equivalentSimulationTime(double timeOs, double timeRec, double timeSim);
double equivalentApplicationTime(double timeOs, double timeRec, double timeSim);
double currentTime() const;
void playbackCamera();
void playbackTimeChange();
@@ -259,6 +283,10 @@ private:
bool _playbackActive_script = false;
bool _hasHitEndOfCameraKeyframes = false;
bool _setSimulationTimeWithNextCameraKeyframe = false;
bool _saveRenderingDuringPlayback = false;
double _saveRenderingDeltaTime = 1.0 / 30.0;
double _saveRenderingCurrentRecordedTime;
static const size_t keyframeHeaderSize_bytes = 33;
static const size_t saveBufferCameraSize_min = 82;
+2
View File
@@ -79,6 +79,8 @@ public:
virtual SurfacePositionHandle calculateSurfacePositionHandle(
const glm::dvec3& targetModelSpace) const;
virtual bool renderedWithDesiredData() const;
RenderBin renderBin() const;
void setRenderBin(RenderBin bin);
bool matchesRenderBinMask(int binMask);
@@ -138,6 +138,11 @@ public:
*/
void setResolveData(ghoul::Dictionary resolveData);
/**
* Mark that one screenshot should be taken
*/
void takeScreenShot();
/**
* Returns the Lua library that contains all Lua functions available to affect the
* rendering.