summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwlsky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp47
1 files changed, 27 insertions, 20 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index e5a7398d4f..91bfc3858c 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -328,6 +328,8 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
// since LLImageGL::bind detects that it's a noop, and optimizes it out.
gGL.getTexUnit(0)->bind(face->getTexture());
LLColor4 color(gSky.mVOSkyp->getMoon().getInterpColor());
+
+#if 0
F32 a = gSky.mVOSkyp->getMoon().getDirection().mV[2];
if (a > 0.f)
{
@@ -335,6 +337,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
}
color.mV[3] = llclamp(a, 0.f, 1.f);
+#endif
if (gPipeline.canUseVertexShaders())
{
@@ -373,34 +376,38 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
- //renderSkyHazeDeferred(origin, camHeightLocal);
-
- renderSkyHaze(origin, camHeightLocal);
-
- if (!gPipeline.useAdvancedAtmospherics() && gPipeline.canUseWindLightShaders())
+ if (gPipeline.canUseWindLightShaders())
{
- LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
- gGL.pushMatrix();
+ if (gPipeline.useAdvancedAtmospherics())
+ {
+ renderSkyHazeDeferred(origin, camHeightLocal);
+ }
+ else
+ {
+ renderSkyHaze(origin, camHeightLocal);
+
+ LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
+ gGL.pushMatrix();
- gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+ gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
- gDeferredStarProgram.bind();
- // *NOTE: have to bind a texture here since register combiners blending in
- // renderStars() requires something to be bound and we might as well only
- // bind the moon's texture once.
- gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture());
+ gDeferredStarProgram.bind();
+ // *NOTE: have to bind a texture here since register combiners blending in
+ // renderStars() requires something to be bound and we might as well only
+ // bind the moon's texture once.
+ gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture());
- renderHeavenlyBodies();
+ renderHeavenlyBodies();
- renderStars();
+ renderStars();
- gDeferredStarProgram.unbind();
+ gDeferredStarProgram.unbind();
- gGL.popMatrix();
- }
+ gGL.popMatrix();
- renderSkyClouds(origin, camHeightLocal);
-
+ renderSkyClouds(origin, camHeightLocal);
+ }
+ }
gGL.setColorMask(true, true);
}