StelSkyImageTile.cpp   StelSkyImageTile.cpp 
skipping to change at line 30 skipping to change at line 30
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelToneReproducer.hpp" #include "StelToneReproducer.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelModuleMgr.hpp"
#include "SolarSystem.hpp"
#include <QDebug> #include <QDebug>
#include <stdio.h> #include <stdio.h>
StelSkyImageTile::StelSkyImageTile() StelSkyImageTile::StelSkyImageTile()
{ {
initCtor(); initCtor();
} }
void StelSkyImageTile::initCtor() void StelSkyImageTile::initCtor()
skipping to change at line 94 skipping to change at line 95
QMultiMap<double, StelSkyImageTile*> result; QMultiMap<double, StelSkyImageTile*> result;
getTilesToDraw(result, core, prj->getViewportConvexPolygon(0, 0), li mitLuminance, true); getTilesToDraw(result, core, prj->getViewportConvexPolygon(0, 0), li mitLuminance, true);
int numToBeLoaded=0; int numToBeLoaded=0;
foreach (StelSkyImageTile* t, result) foreach (StelSkyImageTile* t, result)
if (t->isReadyToDisplay()==false) if (t->isReadyToDisplay()==false)
++numToBeLoaded; ++numToBeLoaded;
updatePercent(result.size(), numToBeLoaded); updatePercent(result.size(), numToBeLoaded);
// Draw in the good order // Draw in the good order
sPainter.enableTexture2d(true); sPainter.setBlending(true, GL_ONE, GL_ONE);
glBlendFunc(GL_ONE, GL_ONE);
QMap<double, StelSkyImageTile*>::Iterator i = result.end(); QMap<double, StelSkyImageTile*>::Iterator i = result.end();
while (i!=result.begin()) while (i!=result.begin())
{ {
--i; --i;
i.value()->drawTile(core, sPainter); i.value()->drawTile(core, sPainter);
} }
deleteUnusedSubTiles(); deleteUnusedSubTiles();
} }
skipping to change at line 257 skipping to change at line 257
if (!tex->bind()) if (!tex->bind())
return false; return false;
if (!texFader) if (!texFader)
{ {
texFader = new QTimeLine(1000, this); texFader = new QTimeLine(1000, this);
texFader->start(); texFader->start();
} }
// Draw the real texture for this image // Draw the real texture for this image
float ad_lum = (luminance>0) ? core->getToneReproducer()->adaptLumin float ad_lum = (luminance>0) ? qMin(1.0f, core->getToneReproducer()-
anceScaled(luminance) : 1.f; >adaptLuminanceScaled(luminance)) : 1.f;
ad_lum=std::min(1.f, ad_lum);
Vec4f color; Vec4f color;
if (alphaBlend==true || texFader->state()==QTimeLine::Running) if (alphaBlend || texFader->state()==QTimeLine::Running)
{ {
if (!alphaBlend) if (!alphaBlend)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); / / Normal transparency mode sPainter.setBlending(true); // Normal transparency m ode
else else
glBlendFunc(GL_ONE, GL_ONE); sPainter.setBlending(true, GL_ONE, GL_ONE); // addit
glEnable(GL_BLEND); ive blending
color.set(ad_lum,ad_lum,ad_lum, texFader->currentValue()); color.set(ad_lum,ad_lum,ad_lum, texFader->currentValue());
} }
else else
{ {
glDisable(GL_BLEND); sPainter.setBlending(false);
color.set(ad_lum,ad_lum,ad_lum, 1.f); color.set(ad_lum,ad_lum,ad_lum, 1.f);
} }
const bool withExtinction=(core->getSkyDrawer()->getFlagHasAtmospher e() && core->getSkyDrawer()->getExtinction().getExtinctionCoefficient()>=0. 01f); const bool withExtinction=(getFrameType()!=StelCore::FrameAltAz && c ore->getSkyDrawer()->getFlagHasAtmosphere() && core->getSkyDrawer()->getExt inction().getExtinctionCoefficient()>=0.01f);
sPainter.enableTexture2d(true);
foreach (const SphericalRegionP& poly, skyConvexPolygons) foreach (const SphericalRegionP& poly, skyConvexPolygons)
{ {
Vec4f extinctedColor = color; Vec4f extinctedColor = color;
if (withExtinction) if (withExtinction)
{ {
Vec3d bary= poly->getPointInside(); // This is a J00 Vec3d bary= poly->getPointInside(); // This is a "fr
0.0 vector that points "somewhere" in the first triangle. ame" vector that points "somewhere" in the first triangle.
Vec3d altAz = core->j2000ToAltAz(bary, StelCore::Ref
ractionOff); // 2017-03: we need a definite J2000 vector:
Vec3d baryJ2000;
double lng, lat, ra, dec; // aux. values for coordin
ate transformations
double eclJ2000, eclJDE;
switch (getFrameType()) // all possible but AzAlt!
{
case StelCore::FrameJ2000:
baryJ2000=bary;
break;
case StelCore::FrameEquinoxEqu:
baryJ2000=core->equinoxEquToJ2000(ba
ry, StelCore::RefractionOff);
break;
case StelCore::FrameObservercentricEclipt
icJ2000:
// For the ecliptic cases, apply clu
msy trafos from StelUtil!
eclJ2000=GETSTELMODULE(SolarSystem)-
>getEarth()->getRotObliquity(2451545.0);
StelUtils::rectToSphe(&lng, &lat, ba
ry);
StelUtils::eclToEqu(lng, lat, eclJ20
00, &ra, &dec);
StelUtils::spheToRect(ra, dec, baryJ
2000);
break;
case StelCore::FrameObservercentricEclipt
icOfDate:
// Trafo to eqDate, then as above.
eclJDE = GETSTELMODULE(SolarSystem)-
>getEarth()->getRotObliquity(core->getJDE());
StelUtils::rectToSphe(&lng, &lat, ba
ry);
StelUtils::eclToEqu(lng, lat, eclJDE
, &ra, &dec); // convert to Equatorial/equinox of date
StelUtils::spheToRect(ra, dec, bary)
;
baryJ2000=core->equinoxEquToJ2000(ba
ry, StelCore::RefractionOff);
break;
case StelCore::FrameGalactic:
baryJ2000=core->galacticToJ2000(bary
);
break;
case StelCore::FrameSupergalactic:
baryJ2000=core->supergalacticToJ2000
(bary);
break;
default:
Q_ASSERT(0);
qDebug() << "StelSkyImageTile: unkno
wn FrameType. Assume J2000.";
baryJ2000=bary;
}
Vec3d altAz = core->j2000ToAltAz(baryJ2000, StelCore
::RefractionOff);
float extinctionMagnitude=0.0f; float extinctionMagnitude=0.0f;
altAz.normalize(); altAz.normalize();
core->getSkyDrawer()->getExtinction().forward(altAz, &extinctionMagnitude); core->getSkyDrawer()->getExtinction().forward(altAz, &extinctionMagnitude);
// compute a simple factor from magnitude loss. // compute a simple factor from magnitude loss.
float extinctionFactor=std::pow(0.4f , extinctionMag nitude); // drop of one magnitude: factor 2.5 or 40% float extinctionFactor=std::pow(0.4f , extinctionMag nitude); // drop of one magnitude: factor 2.5 or 40%
extinctedColor[0]*=fabs(extinctionFactor); extinctedColor[0]*=fabs(extinctionFactor);
extinctedColor[1]*=fabs(extinctionFactor); extinctedColor[1]*=fabs(extinctionFactor);
extinctedColor[2]*=fabs(extinctionFactor); extinctedColor[2]*=fabs(extinctionFactor);
} }
sPainter.setColor(extinctedColor[0], extinctedColor[1], exti nctedColor[2], extinctedColor[3]); sPainter.setColor(extinctedColor[0], extinctedColor[1], exti nctedColor[2], extinctedColor[3]);
 End of changes. 10 change blocks. 
17 lines changed or deleted 71 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/