summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRunitai Linden <davep@lindenlab.com>2020-03-26 16:48:33 -0500
committerRunitai Linden <davep@lindenlab.com>2020-03-26 16:48:33 -0500
commitd756e185730f46fd78e88215e0b4b9fd282fd1d7 (patch)
treeec1fc367436fd8ad904d0344a77bc753086aaa37 /indra/newview
parent9e0cf3edaab99cc1c427e590c179d6dd604f4567 (diff)
SL-12902 Fix for doing the technically correct but compatibility wrong thing WRT light color values.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvovolume.cpp14
-rw-r--r--indra/newview/llvovolume.h17
-rw-r--r--indra/newview/pipeline.cpp13
3 files changed, 26 insertions, 18 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c1dd356586..586d3b66b0 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3234,17 +3234,11 @@ LLColor3 LLVOVolume::getLightBaseColor() const
}
}
-LLColor3 LLVOVolume::getLightColor() const
+LLColor3 LLVOVolume::getLightLinearColor() const
{
- const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
- if (param_block)
- {
- return LLColor3(param_block->getColor()) * param_block->getColor().mV[3];
- }
- else
- {
- return LLColor3(1,1,1);
- }
+ LLColor3 ret = getLightSRGBColor();
+ ret = linearColor3(ret);
+ return ret;
}
LLColor3 LLVOVolume::getLightSRGBColor() const
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index bbe911f488..bf19a01d57 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -251,9 +251,20 @@ public:
void setSpotLightParams(LLVector3 params);
BOOL getIsLight() const;
- LLColor3 getLightBaseColor() const; // not scaled by intensity
- LLColor3 getLightColor() const; // scaled by intensity
- LLColor3 getLightSRGBColor() const; // Used to get the (cached) light color in sRGB color space. Also scaled by intensity.
+
+
+ // Get the light color in sRGB color space NOT scaled by intensity.
+ LLColor3 getLightBaseColor() const;
+
+ //same as getLightSRGBColor()
+ LLColor3 getLightColor() const { return getLightSRGBColor(); }
+
+ // Same as linearColor3(getLightSRGBColor)
+ LLColor3 getLightLinearColor() const;
+
+ // Get the light color in sRGB color space scaled by intensity.
+ LLColor3 getLightSRGBColor() const;
+
LLUUID getLightTextureID() const;
bool isLightSpotlight() const;
LLVector3 getSpotLightParams() const;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index fda79984ab..1765ba227f 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6325,7 +6325,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
mLightMovingMask |= (1<<cur_light);
}
- LLColor4 light_color = sRenderDeferred ? light->getLightSRGBColor() : light->getLightColor();
+ //NOTE: for legacy reasons, send sRGB color to light shader for both deferred and non-deferred path
+ LLColor4 light_color = light->getLightColor();
light_color.mV[3] = 0.0f;
F32 fade = iter->fade;
@@ -8767,7 +8768,8 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
const F32* c = center.getF32ptr();
F32 s = volume->getLightRadius()*1.5f;
- LLColor3 col = volume->getLightSRGBColor();
+ //NOTE: for legacy reasons, send sRGB color to light shader
+ LLColor3 col = volume->getLightColor();
if (col.magVecSquared() < 0.001f)
{
@@ -8859,7 +8861,8 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
setupSpotLight(gDeferredSpotLightProgram, drawablep);
- LLColor3 col = volume->getLightSRGBColor();
+ //NOTE: for legacy reasons, send sRGB color to light shader
+ LLColor3 col = volume->getLightColor();
gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c);
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
@@ -8948,8 +8951,8 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
setupSpotLight(gDeferredMultiSpotLightProgram, drawablep);
- LLColor3 col = volume->getLightSRGBColor();
-
+ //NOTE: for legacy reasons, send sRGB color to light shader
+ LLColor3 col = volume->getLightColor();
gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v);
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, light_size_final);