Atmosphere.cpp   Atmosphere.cpp 
skipping to change at line 48 skipping to change at line 48
Atmosphere::Atmosphere(void) Atmosphere::Atmosphere(void)
: viewport(0,0,0,0) : viewport(0,0,0,0)
, skyResolutionY(44) , skyResolutionY(44)
, skyResolutionX(44) , skyResolutionX(44)
, posGrid(NULL) , posGrid(NULL)
, posGridBuffer(QOpenGLBuffer::VertexBuffer) , posGridBuffer(QOpenGLBuffer::VertexBuffer)
, indicesBuffer(QOpenGLBuffer::IndexBuffer) , indicesBuffer(QOpenGLBuffer::IndexBuffer)
, colorGrid(NULL) , colorGrid(NULL)
, colorGridBuffer(QOpenGLBuffer::VertexBuffer) , colorGridBuffer(QOpenGLBuffer::VertexBuffer)
, averageLuminance(0.f) , averageLuminance(0.f)
, overrideAverageLuminance(false)
, eclipseFactor(1.f) , eclipseFactor(1.f)
, lightPollutionLuminance(0) , lightPollutionLuminance(0)
{ {
setFadeDuration(1.5f); setFadeDuration(1.5f);
QOpenGLShader vShader(QOpenGLShader::Vertex); QOpenGLShader vShader(QOpenGLShader::Vertex);
if (!vShader.compileSourceFile(":/shaders/xyYToRGB.glsl")) if (!vShader.compileSourceFile(":/shaders/xyYToRGB.glsl"))
{ {
qFatal("Error while compiling atmosphere vertex shader: %s", vShader.log().toLatin1().constData()); qFatal("Error while compiling atmosphere vertex shader: %s", vShader.log().toLatin1().constData());
} }
skipping to change at line 309 skipping to change at line 310
// This is done in the openGL shader // This is done in the openGL shader
// Store the back projected position + luminance in the inpu t color to the shader // Store the back projected position + luminance in the inpu t color to the shader
colorGrid[i].set(point[0], point[1], point[2], lumi); colorGrid[i].set(point[0], point[1], point[2], lumi);
} }
colorGridBuffer.bind(); colorGridBuffer.bind();
colorGridBuffer.write(0, colorGrid, (1+skyResolutionX)*(1+skyResolut ionY)*4*4); colorGridBuffer.write(0, colorGrid, (1+skyResolutionX)*(1+skyResolut ionY)*4*4);
colorGridBuffer.release(); colorGridBuffer.release();
// Update average luminance // Update average luminance
averageLuminance = sum_lum/((1+skyResolutionX)*(1+skyResolutionY)); if (!overrideAverageLuminance)
averageLuminance = sum_lum/((1+skyResolutionX)*(1+skyResolut
ionY));
}
// override computable luminance. This is for special operations only, e.g.
for scripting of brightness-balanced image export.
// To return to auto-computed values, set any negative value.
void Atmosphere::setAverageLuminance(float overrideLum)
{
if (overrideLum<0.f)
{
overrideAverageLuminance=false;
averageLuminance=0.f;
}
else
{
overrideAverageLuminance=true;
averageLuminance=overrideLum;
}
} }
// Draw the atmosphere using the precalc values stored in tab_sky // Draw the atmosphere using the precalc values stored in tab_sky
void Atmosphere::draw(StelCore* core) void Atmosphere::draw(StelCore* core)
{ {
if (StelApp::getInstance().getVisionModeNight()) if (StelApp::getInstance().getVisionModeNight())
return; return;
StelToneReproducer* eye = core->getToneReproducer(); StelToneReproducer* eye = core->getToneReproducer();
 End of changes. 2 change blocks. 
1 lines changed or deleted 21 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/