StelSkyDrawer.cpp   StelSkyDrawer.cpp 
skipping to change at line 81 skipping to change at line 81
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()) ;
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()));
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());
// qDebug() << "drawer: clampStellarMag: " << clampStellarMagnitude << " , clampDSOmagnitude: " << clampDSOMagnitude;
bool ok=true; bool ok=true;
setBortleScaleIndex(conf->value("stars/init_bortle_scale",2).toInt(& ok)); setBortleScaleIndex(conf->value("stars/init_bortle_scale",2).toInt(& ok));
if (!ok) if (!ok)
setBortleScaleIndex(2); setBortleScaleIndex(2);
setRelativeStarScale(conf->value("stars/relative_scale",1.0).toFloat (&ok)); setRelativeStarScale(conf->value("stars/relative_scale",1.0).toFloat (&ok));
if (!ok) if (!ok)
setRelativeStarScale(1.0); setRelativeStarScale(1.0);
skipping to change at line 151 skipping to change at line 152
starShaderProgram = NULL; starShaderProgram = NULL;
} }
// Init parameters from config file // Init parameters from config file
void StelSkyDrawer::init() void StelSkyDrawer::init()
{ {
// Load star texture no mipmap: // Load star texture no mipmap:
texHalo = StelApp::getInstance().getTextureManager().createTexture(S telFileMgr::getInstallationDir()+"/textures/star16x16.png"); texHalo = StelApp::getInstance().getTextureManager().createTexture(S telFileMgr::getInstallationDir()+"/textures/star16x16.png");
texBigHalo = StelApp::getInstance().getTextureManager().createTextur e(StelFileMgr::getInstallationDir()+"/textures/haloLune.png"); texBigHalo = StelApp::getInstance().getTextureManager().createTextur e(StelFileMgr::getInstallationDir()+"/textures/haloLune.png");
texSunHalo = StelApp::getInstance().getTextureManager().createTextur e(StelFileMgr::getInstallationDir()+"/textures/halo.png"); texSunHalo = StelApp::getInstance().getTextureManager().createTextur e(StelFileMgr::getInstallationDir()+"/textures/halo.png");
texSunCorona = StelApp::getInstance().getTextureManager().createText ure(StelFileMgr::getInstallationDir()+"/textures/corona.png");
// Create shader program // Create shader program
QOpenGLShader vshader(QOpenGLShader::Vertex); QOpenGLShader vshader(QOpenGLShader::Vertex);
const char *vsrc = const char *vsrc =
"attribute mediump vec2 pos;\n" "attribute mediump vec2 pos;\n"
"attribute mediump vec2 texCoord;\n" "attribute mediump vec2 texCoord;\n"
"attribute mediump vec3 color;\n" "attribute mediump vec3 color;\n"
"uniform mediump mat4 projectionMatrix;\n" "uniform mediump mat4 projectionMatrix;\n"
"varying mediump vec2 texc;\n" "varying mediump vec2 texc;\n"
"varying mediump vec3 outColor;\n" "varying mediump vec3 outColor;\n"
skipping to change at line 468 skipping to change at line 470
++nbPointSources; ++nbPointSources;
if (nbPointSources>=maxPointSources) if (nbPointSources>=maxPointSources)
{ {
// Flush the buffer (draw all buffered stars) // Flush the buffer (draw all buffered stars)
postDrawPointSource(sPainter); postDrawPointSource(sPainter);
} }
return true; return true;
} }
// Draw's the Sun's corona during a solar eclipse on Earth.
void StelSkyDrawer::drawSunCorona(StelPainter* painter, const Vec3f& v, flo
at radius, const Vec3f& color, const float alpha)
{
texSunCorona->bind();
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
painter->enableTexture2d(true);
Vec3f win;
painter->getProjector()->project(v, win);
// For some reason we must mix color with the given alpha as well, e
lse mixing does not work.
painter->setColor(color[0]*alpha, color[1]*alpha, color[2]*alpha, al
pha);
painter->drawSprite2dMode(win[0], win[1], radius);
postDrawPointSource(painter);
}
// Terminate drawing of a 3D model, draw the halo // Terminate drawing of a 3D model, draw the halo
void StelSkyDrawer::postDrawSky3dModel(StelPainter* painter, const Vec3f& v , float illuminatedArea, float mag, const Vec3f& color) void StelSkyDrawer::postDrawSky3dModel(StelPainter* painter, const Vec3f& v , float illuminatedArea, float mag, const Vec3f& color)
{ {
const float pixPerRad = painter->getProjector()->getPixelPerRadAtCen ter(); const float pixPerRad = painter->getProjector()->getPixelPerRadAtCen ter();
// Assume a disk shape // Assume a disk shape
float pixRadius = std::sqrt(illuminatedArea/(60.*60.)*M_PI/180.*M_PI /180.*(pixPerRad*pixPerRad))/M_PI; float pixRadius = std::sqrt(illuminatedArea/(60.*60.)*M_PI/180.*M_PI /180.*(pixPerRad*pixPerRad))/M_PI;
bool noStarHalo = false; bool noStarHalo = false;
if (mag<-15.f) if (mag<-15.f)
 End of changes. 4 change blocks. 
1 lines changed or deleted 25 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/