Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/core/modules/AtmosphereShowMySky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,15 @@ Vec4f AtmosphereShowMySky::getMeanPixelValue()

bool AtmosphereShowMySky::dynamicResolution(StelProjectorP prj, Vec3d &currPos, int width, int height)
{
if (!flagDynamicResolution)
return false;
if (!flagDynamicResolution) // There's nothing to do here, we're drawing
return false; // in full resolution and full frame rate.

// If the scene is rendered in real time and is practically static,
// Stellarium generates approximately 18 frames per second.
// We draw about one atmosphere per second at full resolution.
// For faster-moving scenes, Stellarium increases the frame rate to the maximum,
// perhaps 50 frames per second depending on the hardware's capabilities.
// We draw about 10 atmospheres per second in reduced resolution.

const auto currFov=prj->getFov(), currFad=fader.getInterstate();
Vec3d currSun;
Expand All @@ -651,16 +658,15 @@ bool AtmosphereShowMySky::dynamicResolution(StelProjectorP prj, Vec3d &currPos,
dynResTimer--; // count down to redraw
return true;
}
// if there is a timeout, we draw with full resolution
// if the change is too large, we draw with reduced resolution
atmoRes=timeout?1:reducedResolution;
// if the change is too big, we draw with reduced resolution, otherwise with full resolution
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, the previous comment was a bit more understandable. I think the following would be better:

If the change is too big, the scene is considered dynamic and needs a higher frame rate, so it's rendered in lower resolution. Otherwise there's been a timeout, so the scene is updated in full resolution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atmoRes=changed?reducedResolution:1;
if (prevRes!=atmoRes)
{
resizeRenderTarget(width, height);
qCDebug(Atmo) << "dynResTimer" << dynResTimer << "atmoRes" << atmoRes << "changeOfView" << changeOfView.norm() << changeOfView;
}
// At reduced resolution, we hurry to redraw - at full resolution, we have time.
dynResTimer=timeout?17:5;
dynResTimer=changed?5:17; // dynResTimer is like a clock divider.
prevRes=atmoRes;
prevFov=currFov;
prevFad=currFad;
Expand Down
Loading