Use the "proper" alpha value (i.e., the one from the original shader). This

makes the sky somewhat darker, but that probably just means we need more
scattering or a brighter sun.
This commit is contained in:
Andrzej Kapolka 2013-05-08 11:50:59 -07:00
parent 82f16e7f34
commit 5138f62aef
3 changed files with 2 additions and 4 deletions

View file

@ -44,5 +44,5 @@ void main (void)
float fCos = dot(v3LightPos, v3Direction) / length(v3Direction);
float fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos*fCos) / pow(1.0 + g2 - 2.0*g*fCos, 1.5);
gl_FragColor = gl_Color + fMiePhase * gl_SecondaryColor;
gl_FragColor.a = 1.0; // gl_FragColor.b;
gl_FragColor.a = gl_FragColor.b;
}

View file

@ -44,5 +44,5 @@ void main (void)
float fCos = dot(v3LightPos, v3Direction) / length(v3Direction);
float fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos*fCos) / pow(1.0 + g2 - 2.0*g*fCos, 1.5);
gl_FragColor = gl_Color + fMiePhase * gl_SecondaryColor;
gl_FragColor.a = 1.0; // gl_FragColor.b;
gl_FragColor.a = gl_FragColor.b;
}

View file

@ -73,12 +73,10 @@ void Environment::renderAtmosphere(Camera& camera) {
program->setUniform(locations[G_LOCATION], -0.990f);
program->setUniform(locations[G2_LOCATION], -0.990f * -0.990f);
glFrontFace(GL_CW);
glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
glutSolidSphere(getAtmosphereOuterRadius(), 100, 50);
glDepthMask(GL_TRUE);
glFrontFace(GL_CCW);
program->release();