Skip to content

Commit

Permalink
Scale planet halo properly
Browse files Browse the repository at this point in the history
  • Loading branch information
10110111 committed Jan 27, 2025
1 parent 3427f58 commit 9a4ccfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/StelSkyDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 9a4ccfa

Please sign in to comment.