summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwlsky.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-01-24 14:54:11 -0800
committerGraham Linden <graham@lindenlab.com>2019-01-24 14:54:11 -0800
commit966dc7fc8fb1fade861e8070e9c5fbbfe4d0cb45 (patch)
treea1cbc6e22bf8e443a32aab1cd78e0fc6049e3674 /indra/newview/lldrawpoolwlsky.cpp
parenta6f92d8190e8771d6a3372eb456dbb97c7ca0c8d (diff)
SL-10276
SL-9851 Fix cloud shaders to ignore clouds when cloud_scale is 0. Fix creation of heavenly body geo to avoid degenerate vector math and not randomly flip orientation when crossing zenith. Add sun_up_factor to eliminate sun glow around moon when sun is down.
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index e6306b391a..f9ab241988 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -232,6 +232,8 @@ void LLDrawPoolWLSky::renderSkyHazeAdvanced(const LLVector3& camPosLocal, F32 ca
sky_shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m);
+ sky_shader->uniform1f(LLShaderMgr::SUN_UP_FACTOR, psky->getIsSunUp() ? 1.0f : 0.0f);
+
sky_shader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
renderFsSky(camPosLocal, camHeightLocal, sky_shader);
@@ -266,6 +268,8 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
sky_shader->uniform1f(LLShaderMgr::DROPLET_RADIUS, droplet_radius);
sky_shader->uniform1f(LLShaderMgr::ICE_LEVEL, ice_level);
+ sky_shader->uniform1f(LLShaderMgr::SUN_UP_FACTOR, psky->getIsSunUp() ? 1.0f : 0.0f);
+
/// Render the skydome
renderDome(origin, camHeightLocal, sky_shader);
@@ -475,7 +479,7 @@ void LLDrawPoolWLSky::renderSkyCloudsAdvanced(const LLVector3& camPosLocal, F32
cloudshader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
cloudshader->uniform1f(LLShaderMgr::CLOUD_VARIANCE, cloud_variance);
-
+ cloudshader->uniform1f(LLShaderMgr::SUN_UP_FACTOR, psky->getIsSunUp() ? 1.0f : 0.0f);
cloudshader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
/// Render the skydome
@@ -530,6 +534,7 @@ void LLDrawPoolWLSky::renderSkyCloudsDeferred(const LLVector3& camPosLocal, F32
cloudshader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
cloudshader->uniform1f(LLShaderMgr::CLOUD_VARIANCE, cloud_variance);
+ cloudshader->uniform1f(LLShaderMgr::SUN_UP_FACTOR, psky->getIsSunUp() ? 1.0f : 0.0f);
/// Render the skydome
renderDome(camPosLocal, camHeightLocal, cloudshader);