From 75858d9f3ff1f6adae4e6b4c4726eecfc57d0e11 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 19 Oct 2018 17:45:40 +0100 Subject: SL-9929 Replace WL atmospherics sun color calcs, fix water specular sunlight contribution to use them, and do not add moon contribution during daytime. --- indra/newview/lldrawpoolwater.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'indra/newview/lldrawpoolwater.cpp') diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 9eb61a1a1f..d217f95cf3 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -496,7 +496,6 @@ void LLDrawPoolWater::shade() LLColor3 light_diffuse(0,0,0); F32 light_exp = 0.0f; LLVector3 light_dir; - LLColor3 light_color; LLEnvironment& environment = LLEnvironment::instance(); LLSettingsWater::ptr_t pwater = environment.getCurrentWater(); @@ -510,24 +509,17 @@ void LLDrawPoolWater::shade() if (sun_up) { - light_color = light_color + psky->getSunAmbient(); - light_diffuse += psky->getSunDiffuse(); + light_diffuse += voskyp->getSun().getColorCached(); + } + // moonlight is several orders of magnitude less bright than sunlight, + // so only use this color when the moon alone is showing + else if (moon_up) + { + light_diffuse += psky->getMoonDiffuse(); } light_exp = light_dir * LLVector3(light_dir.mV[0], light_dir.mV[1], 0.f); - if (moon_up) - { - LLColor3 moon_diffuse_color = psky->getMoonDiffuse(); - light_color += moon_diffuse_color; - light_diffuse += moon_diffuse_color * 0.5f; - - if (!sun_up) - { - light_exp = light_dir * LLVector3(light_dir.mV[0], light_dir.mV[1], 0.f); - } - } - light_diffuse.normalize(); light_diffuse *= (light_exp + 0.25f); -- cgit v1.3