summaryrefslogtreecommitdiff
path: root/indra/llprimitive
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/llprimitive
parent9e0cf3edaab99cc1c427e590c179d6dd604f4567 (diff)
SL-12902 Fix for doing the technically correct but compatibility wrong thing WRT light color values.
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llprimitive.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 20b5ad8eff..ed89462e5a 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -132,8 +132,7 @@ extern const F32 LIGHT_MAX_CUTOFF;
class LLLightParams : public LLNetworkData
{
protected:
- LLColor4 mColor; // alpha = intensity
- LLColor4 mSRGBColor; // Only used in deferred (for now?)
+ LLColor4 mColor; // gamma corrected color (sRGB), alpha = intensity
F32 mRadius;
F32 mFalloff;
F32 mCutoff;
@@ -151,13 +150,20 @@ public:
bool fromLLSD(LLSD& sd);
- void setColor(const LLColor4& color) { mColor = color; mColor.clamp(); mSRGBColor = srgbColor4(mColor); }
+ // set the color
+ // color - gamma corrected color value (directly taken from an on-screen color swatch)
+ void setColor(const LLColor4& color) { mColor = color; mColor.clamp(); }
void setRadius(F32 radius) { mRadius = llclamp(radius, LIGHT_MIN_RADIUS, LIGHT_MAX_RADIUS); }
void setFalloff(F32 falloff) { mFalloff = llclamp(falloff, LIGHT_MIN_FALLOFF, LIGHT_MAX_FALLOFF); }
void setCutoff(F32 cutoff) { mCutoff = llclamp(cutoff, LIGHT_MIN_CUTOFF, LIGHT_MAX_CUTOFF); }
+ // same as getSRGBColor
LLColor4 getColor() const { return mColor; }
- LLColor4 getSRGBColor() const { return mSRGBColor; }
+ // get the sRGB (gamma corrected) color of this light
+ LLColor4 getSRGBColor() const { return mColor; }
+ // get the linear space color of this light
+ LLColor4 getLinearColor() const { return linearColor4(mColor); }
+
F32 getRadius() const { return mRadius; }
F32 getFalloff() const { return mFalloff; }
F32 getCutoff() const { return mCutoff; }