From 9a4ccfa427958ccd5eb182834a4fd51af4a90941 Mon Sep 17 00:00:00 2001 From: Ruslan Kabatsayev Date: Thu, 23 Jan 2025 14:15:39 +0800 Subject: [PATCH] Scale planet halo properly --- src/core/StelSkyDrawer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/StelSkyDrawer.cpp b/src/core/StelSkyDrawer.cpp index 001c5a641efc02..7a6953dd0343a4 100644 --- a/src/core/StelSkyDrawer.cpp +++ b/src/core/StelSkyDrawer.cpp @@ -540,6 +540,7 @@ void StelSkyDrawer::drawSunCorona(StelPainter* painter, const Vec3f& v, float ra // Terminate drawing of a 3D model, draw the halo void StelSkyDrawer::postDrawSky3dModel(StelPainter* painter, const Vec3d& v, float illuminatedArea, float mag, const Vec3f& color, const bool isSun) { + const float scale = StelApp::getInstance().getScreenScale(); const float pixPerRad = painter->getProjector()->getPixelPerRadAtCenter(); // Assume a disk shape float pixRadius = std::sqrt(illuminatedArea/(60.f*60.f)*M_PI_180f*M_PI_180f*(pixPerRad*pixPerRad))/M_PIf; @@ -581,8 +582,8 @@ void StelSkyDrawer::postDrawSky3dModel(StelPainter* painter, const Vec3d& v, flo // so that the radius of the halo is small enough to be not visible (so that we see the disk) // TODO: Change drawing halo to more realistic view of stars and planets - float tStart = 3.f; // Was 2.f: planet's halo is too dim. Atque 2020-11-12: No need to change these anymore. It appears that this has to do with halo size vs FOV (?). - float tStop = 6.f; + float tStart = 3.f*scale; // Was 2.f: planet's halo is too dim. Atque 2020-11-12: No need to change these anymore. It appears that this has to do with halo size vs FOV (?). + float tStop = 6.f*scale; bool truncated=false; float maxHaloRadius = qMax(tStart*6.f, pixRadius*3.f); //Atque 2020-11-12: Careful, if tStart*6.f is too big (tStart*10.f or something), the Moon gets a ridiculously big halo.