StelSkyDrawer.cpp   StelSkyDrawer.cpp 
skipping to change at line 76 skipping to change at line 76
oldLum(-1.f), oldLum(-1.f),
big3dModelHaloRadius(150.f) big3dModelHaloRadius(150.f)
{ {
setObjectName("StelSkyDrawer"); setObjectName("StelSkyDrawer");
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
initColorTableFromConfigFile(conf); initColorTableFromConfigFile(conf);
setFlagHasAtmosphere(conf->value("landscape/flag_atmosphere", true). toBool()); setFlagHasAtmosphere(conf->value("landscape/flag_atmosphere", true). toBool());
setTwinkleAmount(conf->value("stars/star_twinkle_amount",0.3).toFloa t()); setTwinkleAmount(conf->value("stars/star_twinkle_amount",0.3).toFloa t());
setFlagTwinkle(conf->value("stars/flag_star_twinkle",true).toBool()) ; setFlagTwinkle(conf->value("stars/flag_star_twinkle",true).toBool()) ;
setFlagForcedTwinkle(conf->value("stars/flag_forced_twinkle",false). toBool());
setMaxAdaptFov(conf->value("stars/mag_converter_max_fov",70.0).toFlo at()); setMaxAdaptFov(conf->value("stars/mag_converter_max_fov",70.0).toFlo at());
setMinAdaptFov(conf->value("stars/mag_converter_min_fov",0.1).toFloa t()); setMinAdaptFov(conf->value("stars/mag_converter_min_fov",0.1).toFloa t());
setFlagLuminanceAdaptation(conf->value("viewing/use_luminance_adapta tion",true).toBool()); setFlagLuminanceAdaptation(conf->value("viewing/use_luminance_adapta tion",true).toBool());
setFlagStarMagnitudeLimit((conf->value("astro/flag_star_magnitude_li mit", false).toBool())); setFlagStarMagnitudeLimit((conf->value("astro/flag_star_magnitude_li mit", false).toBool()));
setCustomStarMagnitudeLimit(conf->value("astro/star_magnitude_limit" , 6.5).toFloat()); setCustomStarMagnitudeLimit(conf->value("astro/star_magnitude_limit" , 6.5).toFloat());
setFlagPlanetMagnitudeLimit((conf->value("astro/flag_planet_magnitud e_limit", false).toBool())); setFlagPlanetMagnitudeLimit((conf->value("astro/flag_planet_magnitud e_limit", false).toBool()));
setCustomPlanetMagnitudeLimit(conf->value("astro/planet_magnitude_li mit", 6.5).toFloat()); setCustomPlanetMagnitudeLimit(conf->value("astro/planet_magnitude_li mit", 6.5).toFloat());
setFlagNebulaMagnitudeLimit((conf->value("astro/flag_nebula_magnitud e_limit", false).toBool())); setFlagNebulaMagnitudeLimit((conf->value("astro/flag_nebula_magnitud e_limit", false).toBool()));
setCustomNebulaMagnitudeLimit(conf->value("astro/nebula_magnitude_li mit", 8.5).toFloat()); setCustomNebulaMagnitudeLimit(conf->value("astro/nebula_magnitude_li mit", 8.5).toFloat());
skipping to change at line 215 skipping to change at line 216
{ {
if (fov < minAdaptFov) if (fov < minAdaptFov)
fov = minAdaptFov; fov = minAdaptFov;
} }
// GZ: Light pollution must take global atmosphere setting into acou nt! // GZ: Light pollution must take global atmosphere setting into acou nt!
// moved parts from setBortleScale() here // moved parts from setBortleScale() here
// These value have been calibrated by hand, looking at the faintest star in stellarium at around 40 deg FOV // These value have been calibrated by hand, looking at the faintest star in stellarium at around 40 deg FOV
// They should roughly match the scale described at http://en.wikipe dia.org/wiki/Bortle_Dark-Sky_Scale // They should roughly match the scale described at http://en.wikipe dia.org/wiki/Bortle_Dark-Sky_Scale
static const float bortleToInScale[9] = {2.45f, 1.55f, 1.0f, 0.63f, 0.40f, 0.24f, 0.23f, 0.145f, 0.09f}; static const float bortleToInScale[9] = {2.45f, 1.55f, 1.0f, 0.63f, 0.40f, 0.24f, 0.23f, 0.145f, 0.09f};
if (getFlagHasAtmosphere()) if (getFlagHasAtmosphere() && core->getJD()>2387627.5) // JD given i s J1825.0; ignore Bortle scale index before that.
setInputScale(bortleToInScale[bortleScaleIndex-1]); setInputScale(bortleToInScale[bortleScaleIndex-1]);
else else
setInputScale(bortleToInScale[0]); setInputScale(bortleToInScale[0]);
// This factor is fully arbitrary. It corresponds to the collecting area x exposure time of the instrument // This factor is fully arbitrary. It corresponds to the collecting area x exposure time of the instrument
// It is based on a power law, so that it varies progressively with the FOV to smoothly switch from human // It is based on a power law, so that it varies progressively with the FOV to smoothly switch from human
// vision to binocculares/telescope. Use a max of 0.7 because after that the atmosphere starts to glow too much! // vision to binocculares/telescope. Use a max of 0.7 because after that the atmosphere starts to glow too much!
float powFactor = std::pow(60.f/qMax(0.7f,fov), 0.8f); float powFactor = std::pow(60.f/qMax(0.7f,fov), 0.8f);
eye->setInputScale(inScale*powFactor); eye->setInputScale(inScale*powFactor);
skipping to change at line 433 skipping to change at line 434
// Why do we need Vec3d here? Try with Vec3f win. // Why do we need Vec3d here? Try with Vec3f win.
// Vec3d win; // Vec3d win;
// if (!(checkInScreen ? sPainter->getProjector()->projectCheck(Vec3d(v [0],v[1],v[2]), win) : sPainter->getProjector()->project(Vec3d(v[0],v[1],v[ 2]), win))) // if (!(checkInScreen ? sPainter->getProjector()->projectCheck(Vec3d(v [0],v[1],v[2]), win) : sPainter->getProjector()->project(Vec3d(v[0],v[1],v[ 2]), win)))
// return false; // return false;
Vec3f win; Vec3f win;
if (!(checkInScreen ? sPainter->getProjector()->projectCheck(v, win) : sPainter->getProjector()->project(v, win))) if (!(checkInScreen ? sPainter->getProjector()->projectCheck(v, win) : sPainter->getProjector()->project(v, win)))
return false; return false;
const float radius = rcMag.radius; const float radius = rcMag.radius;
// Random coef for star twinkling. twinkleFactor can introduce heigh t-dependent twinkling. // Random coef for star twinkling. twinkleFactor can introduce heigh t-dependent twinkling.
const float tw = (flagStarTwinkle && flagHasAtmosphere) ? (1.f-twink leFactor*twinkleAmount*qrand()/RAND_MAX)*rcMag.luminance : rcMag.luminance; const float tw = (flagStarTwinkle && (flagHasAtmosphere || flagForce dTwinkle)) ? (1.f-twinkleFactor*twinkleAmount*qrand()/RAND_MAX)*rcMag.lumin ance : rcMag.luminance;
// If the rmag is big, draw a big halo // If the rmag is big, draw a big halo
if (radius>MAX_LINEAR_RADIUS+5.f) if (radius>MAX_LINEAR_RADIUS+5.f)
{ {
float cmag = qMin(rcMag.luminance,(float)(radius-(MAX_LINEAR _RADIUS+5.f))/30.f); float cmag = qMin(rcMag.luminance,(float)(radius-(MAX_LINEAR _RADIUS+5.f))/30.f);
float rmag = 150.f; float rmag = 150.f;
if (cmag>1.f) if (cmag>1.f)
cmag = 1.f; cmag = 1.f;
texBigHalo->bind(); texBigHalo->bind();
skipping to change at line 522 skipping to change at line 523
Vec3f win; Vec3f win;
painter->getProjector()->project(v, win); painter->getProjector()->project(v, win);
painter->setColor(color[0]*cmag, color[1]*cmag, color[2]*cma g); painter->setColor(color[0]*cmag, color[1]*cmag, color[2]*cma g);
painter->drawSprite2dModeNoDeviceScale(win[0], win[1], rmag) ; painter->drawSprite2dModeNoDeviceScale(win[0], win[1], rmag) ;
noStarHalo = true; noStarHalo = true;
} }
// Now draw the halo according the object brightness // Now draw the halo according the object brightness
bool save = flagStarTwinkle; bool save = flagStarTwinkle;
flagStarTwinkle = false; flagStarTwinkle = false;
bool saveP = flagForcedTwinkle;
flagForcedTwinkle = false;
RCMag rcm; RCMag rcm;
computeRCMag(mag, &rcm); computeRCMag(mag, &rcm);
// We now have the radius and luminosity of the small halo // We now have the radius and luminosity of the small halo
// If the disk of the planet is big enough to be visible, we should adjust the eye adaptation luminance // If the disk of the planet is big enough to be visible, we should adjust the eye adaptation luminance
// so that the radius of the halo is small enough to be not visible (so that we see the disk) // 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 pla nets // TODO: Change drawing halo to more realistic view of stars and pla nets
float tStart = 3.f; // Was 2.f: planet's halo is too dim float tStart = 3.f; // Was 2.f: planet's halo is too dim
skipping to change at line 569 skipping to change at line 572
} }
} }
if (!noStarHalo) if (!noStarHalo)
{ {
preDrawPointSource(painter); preDrawPointSource(painter);
drawPointSource(painter, v, rcm, color); drawPointSource(painter, v, rcm, color);
postDrawPointSource(painter); postDrawPointSource(painter);
} }
flagStarTwinkle=save; flagStarTwinkle=save;
flagForcedTwinkle=saveP;
} }
float StelSkyDrawer::findWorldLumForMag(float mag, float targetRadius) float StelSkyDrawer::findWorldLumForMag(float mag, float targetRadius)
{ {
const float saveLum = eye->getWorldAdaptationLuminance(); // s ave const float saveLum = eye->getWorldAdaptationLuminance(); // s ave
// Compute the luminance by dichotomy // Compute the luminance by dichotomy
float a=0.001f; float a=0.001f;
float b=500000.f; float b=500000.f;
RCMag rcmag; RCMag rcmag;
 End of changes. 5 change blocks. 
2 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/