summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolwlsky.cpp
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2019-03-29 08:11:56 -0700
committerGeenz <geenz@geenzo.com>2019-03-29 08:11:56 -0700
commit57d88a8a98ef8663b9064b12143beb4068e58f86 (patch)
tree8b37cf56aa5e6d0882caee2bcd79b22c90f5350b /indra/newview/lldrawpoolwlsky.cpp
parent3fa8b844c39311a2e4e319a8d4f7ab2c848ae140 (diff)
Gamma correction pass 2:
Make sure lights are in the correct color space. Bonus: cache the sRGB color in setLightColor on point and spot lights. Frees up a pow and some multiplies on the CPU every frame.
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index e608f6eaf2..7f59852b62 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -503,7 +503,12 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor());
- sun_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, color.mV);
+ if (LLPipeline::RenderDeferred) {
+ sun_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, srgbColor4(color).mV);
+ }
+ else {
+ sun_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, color.mV);
+ }
sun_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
LLFacePool::LLOverrideFaceColor color_override(this, color);
@@ -554,9 +559,15 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
F32 moon_brightness = (float)psky->getMoonBrightness();
moon_shader->uniform1f(LLShaderMgr::MOON_BRIGHTNESS, moon_brightness);
- moon_shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, gSky.mVOSkyp->getMoon().getColor().mV);
- moon_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, color.mV);
+ if (LLPipeline::RenderDeferred) {
+ moon_shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, srgbColor4(gSky.mVOSkyp->getMoon().getColor()).mV);
+ moon_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, srgbColor4(color).mV);
+ }
+ else {
+ moon_shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, gSky.mVOSkyp->getMoon().getColor().mV);
+ moon_shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, color.mV);
+ }
moon_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
LLFacePool::LLOverrideFaceColor color_override(this, color);