StelSkyDrawer.cpp   StelSkyDrawer.cpp 
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifdef USE_OPENGL_ES2 #ifdef USE_OPENGL_ES2
#include "GLES2/gl2.h" #include "GLES2/gl2.h"
#endif #endif
#ifndef GL_POINT_SPRITE #ifndef GL_POINT_SPRITE
#define GL_POINT_SPRITE 0x8861 #define GL_POINT_SPRITE 0x8861
#endif #endif
#ifndef GL_VERTEX_PROGRAM_POINT_SIZE #ifndef GL_VERTEX_PROGRAM_POINT_SIZE
skipping to change at line 109 skipping to change at line 109
} }
setAbsoluteStarScale(conf->value("stars/absolute_scale",1.0).toFloat (&ok)); setAbsoluteStarScale(conf->value("stars/absolute_scale",1.0).toFloat (&ok));
if (!ok) if (!ok)
{ {
conf->setValue("stars/absolute_scale",1.0); conf->setValue("stars/absolute_scale",1.0);
setAbsoluteStarScale(1.0); setAbsoluteStarScale(1.0);
ok = true; ok = true;
} }
//GZ: load 3 values from config for now. TODO: make adjustable with GUI! //GZ: load 3 values from config.
setExtinctionCoefficient(conf->value("landscape/atmospheric_extincti on_coefficient",0.2).toDouble(&ok)); setExtinctionCoefficient(conf->value("landscape/atmospheric_extincti on_coefficient",0.2).toDouble(&ok));
if (!ok) if (!ok)
{ {
conf->setValue("landscape/atmospheric_extinction_coefficient ",0.2); conf->setValue("landscape/atmospheric_extinction_coefficient ",0.2);
setExtinctionCoefficient(0.2); setExtinctionCoefficient(0.2);
ok = true; ok = true;
} }
setAtmosphereTemperature(conf->value("landscape/temperature_C",15.0) .toDouble(&ok)); setAtmosphereTemperature(conf->value("landscape/temperature_C",15.0) .toDouble(&ok));
if (!ok) if (!ok)
{ {
skipping to change at line 245 skipping to change at line 245
if (fov > maxAdaptFov) if (fov > maxAdaptFov)
{ {
fov = maxAdaptFov; fov = maxAdaptFov;
} }
else else
{ {
if (fov < minAdaptFov) if (fov < minAdaptFov)
fov = minAdaptFov; fov = minAdaptFov;
} }
// GZ: Light pollution must take global atmosphere setting into acou
nt!
// moved parts from setBortleScale() here
// 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
static const float bortleToInScale[9] = {2.45, 1.55, 1.0, 0.63, 0.40
, 0.24, 0.23, 0.145, 0.09};
if (getFlagHasAtmosphere())
setInputScale(bortleToInScale[bortleScaleIndex-1]);
else
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);
// Set the fov factor for point source luminance computation // Set the fov factor for point source luminance computation
// the division by powFactor should in principle not be here, but it doesn't look nice if removed // the division by powFactor should in principle not be here, but it doesn't look nice if removed
lnfovFactor = std::log(1.f/50.f*2025000.f* 60.f*60.f / (fov*fov) / ( EYE_RESOLUTION*EYE_RESOLUTION)/powFactor/1.4f); lnfovFactor = std::log(1.f/50.f*2025000.f* 60.f*60.f / (fov*fov) / ( EYE_RESOLUTION*EYE_RESOLUTION)/powFactor/1.4f);
skipping to change at line 732 skipping to change at line 742
qWarning() << "WARING: Bortle scale index range is [1;9], gi ven" << bIndex; qWarning() << "WARING: Bortle scale index range is [1;9], gi ven" << bIndex;
bIndex = 1; bIndex = 1;
} }
if (bIndex>9) if (bIndex>9)
{ {
qWarning() << "WARING: Bortle scale index range is [1;9], gi ven" << bIndex; qWarning() << "WARING: Bortle scale index range is [1;9], gi ven" << bIndex;
bIndex = 9; bIndex = 9;
} }
bortleScaleIndex = bIndex; bortleScaleIndex = bIndex;
// GZ: I moved this block to update()
// 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.45, 1.55, 1.0, 0.63, 0.40 // static const float bortleToInScale[9] = {2.45, 1.55, 1.0, 0.63, 0
, 0.24, 0.23, 0.145, 0.09}; .40, 0.24, 0.23, 0.145, 0.09};
setInputScale(bortleToInScale[bIndex-1]); // setInputScale(bortleToInScale[bIndex-1]);
} }
// New colors // New colors
Vec3f StelSkyDrawer::colorTable[128] = { Vec3f StelSkyDrawer::colorTable[128] = {
Vec3f(0.602745,0.713725,1.000000), Vec3f(0.602745,0.713725,1.000000),
Vec3f(0.604902,0.715294,1.000000), Vec3f(0.604902,0.715294,1.000000),
Vec3f(0.607059,0.716863,1.000000), Vec3f(0.607059,0.716863,1.000000),
Vec3f(0.609215,0.718431,1.000000), Vec3f(0.609215,0.718431,1.000000),
Vec3f(0.611372,0.720000,1.000000), Vec3f(0.611372,0.720000,1.000000),
Vec3f(0.613529,0.721569,1.000000), Vec3f(0.613529,0.721569,1.000000),
 End of changes. 5 change blocks. 
6 lines changed or deleted 20 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/