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.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 26454d2bd1..0d49c5a339 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -94,7 +94,7 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass )
void LLDrawPoolWLSky::endRenderPass( S32 pass )
{
sky_shader = nullptr;
- cloud_shader = nullptr;
+ cloud_shader = nullptr;
sun_shader = nullptr;
moon_shader = nullptr;
}
@@ -118,7 +118,7 @@ void LLDrawPoolWLSky::beginDeferredPass(S32 pass)
void LLDrawPoolWLSky::endDeferredPass(S32 pass)
{
sky_shader = nullptr;
- cloud_shader = nullptr;
+ cloud_shader = nullptr;
sun_shader = nullptr;
moon_shader = nullptr;
}
@@ -174,8 +174,8 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
sky_shader->bindTexture(LLShaderMgr::ILLUMINANCE_TEX, gAtmosphere->getIlluminance());
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
- LLVector4 sun_dir = LLEnvironment::instance().getClampedSunNorm();
- LLVector4 moon_dir = LLEnvironment::instance().getClampedMoonNorm();
+ LLVector3 sun_dir = LLEnvironment::instance().getSunDirection();
+ LLVector3 moon_dir = LLEnvironment::instance().getMoonDirection();
F32 sunSize = (float)cosf(psky->getSunArcRadians());
sky_shader->uniform1f(LLShaderMgr::SUN_SIZE, sunSize);
@@ -189,13 +189,6 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
sky_shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m);
- // clouds are rendered along with sky in adv atmo
- if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp->getCloudNoiseTex())
- {
- sky_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, gSky.mVOSkyp->getCloudNoiseTex());
- sky_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP_NEXT, gSky.mVOSkyp->getCloudNoiseTexNext());
- }
-
sky_shader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
renderFsSky(camPosLocal, camHeightLocal, sky_shader);
@@ -504,22 +497,19 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
if (gPipeline.canUseWindLightShaders())
{
+ if (gPipeline.useAdvancedAtmospherics())
+ {
+ renderSkyHazeDeferred(origin, camHeightLocal);
+ renderHeavenlyBodies();
+ }
+ else
{
// Disable depth-test for sky, but re-enable depth writes for the cloud
// rendering below so the cloud shader can write out depth for the stars to test against
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
- if (gPipeline.useAdvancedAtmospherics())
- {
- renderSkyHazeDeferred(origin, camHeightLocal);
- }
- else
- {
- renderSkyHaze(origin, camHeightLocal);
-
- }
- renderHeavenlyBodies();
+ renderSkyHaze(origin, camHeightLocal);
+ renderHeavenlyBodies();
}
-
renderSkyClouds(origin, camHeightLocal);
}
gGL.setColorMask(true, true);