summaryrefslogtreecommitdiff
path: root/indra/llprimitive
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/llprimitive
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/llprimitive')
-rw-r--r--indra/llprimitive/llprimitive.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index c138c2ac2b..677606abd1 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -133,6 +133,7 @@ class LLLightParams : public LLNetworkData
{
protected:
LLColor4 mColor; // alpha = intensity
+ LLColor4 msRGBColor; // Only used in deferred (for now?)
F32 mRadius;
F32 mFalloff;
F32 mCutoff;
@@ -150,12 +151,13 @@ public:
bool fromLLSD(LLSD& sd);
- void setColor(const LLColor4& color) { mColor = color; mColor.clamp(); }
+ void setColor(const LLColor4& color) { mColor = color; mColor.clamp(); msRGBColor = srgbColor4(mColor); }
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); }
LLColor4 getColor() const { return mColor; }
+ LLColor4 getsRGBColor() const { return msRGBColor; }
F32 getRadius() const { return mRadius; }
F32 getFalloff() const { return mFalloff; }
F32 getCutoff() const { return mCutoff; }