From 57d88a8a98ef8663b9064b12143beb4068e58f86 Mon Sep 17 00:00:00 2001 From: Geenz Date: Fri, 29 Mar 2019 08:11:56 -0700 Subject: 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. --- indra/newview/llvovolume.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvovolume.h') diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 0882fc095d..aeabcda911 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -251,6 +251,7 @@ public: 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. LLUUID getLightTextureID() const; bool isLightSpotlight() const; LLVector3 getSpotLightParams() const; -- cgit v1.2.3 From 0272c47e5a31cf972e02fbf14cb2642f86f75d78 Mon Sep 17 00:00:00 2001 From: Geenz Date: Fri, 29 Mar 2019 11:57:45 -0700 Subject: Tweaked naming a bit, also white space. Will wait for a response from @graham_linden regarding moving the sRGB conversion functions in llmath.h to llrender. --- indra/newview/llvovolume.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.h') diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index aeabcda911..da2b086f4a 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -251,7 +251,7 @@ public: 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. + LLColor3 getLightSRGBColor() const; // Used to get the (cached) light color in sRGB color space. Also scaled by intensity. LLUUID getLightTextureID() const; bool isLightSpotlight() const; LLVector3 getSpotLightParams() const; -- cgit v1.2.3 From d756e185730f46fd78e88215e0b4b9fd282fd1d7 Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Thu, 26 Mar 2020 16:48:33 -0500 Subject: SL-12902 Fix for doing the technically correct but compatibility wrong thing WRT light color values. --- indra/newview/llvovolume.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.h') 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; -- cgit v1.2.3 From e468d8018634b51f329eae17485c3358c0a3630b Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Fri, 27 Mar 2020 17:32:01 -0500 Subject: SL-12902 Better fix for light color values in color swatch not matching light color values inworld. --- indra/newview/llvovolume.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvovolume.h') diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index bf19a01d57..776b6a16b0 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -242,7 +242,11 @@ public: // For Lights void setIsLight(BOOL is_light); - void setLightColor(const LLColor3& color); + //set the gamma-corrected (sRGB) color of this light + void setLightSRGBColor(const LLColor3& color); + //set the linear color of this light + void setLightLinearColor(const LLColor3& color); + void setLightIntensity(F32 intensity); void setLightRadius(F32 radius); void setLightFalloff(F32 falloff); @@ -254,12 +258,13 @@ public: // Get the light color in sRGB color space NOT scaled by intensity. - LLColor3 getLightBaseColor() const; - - //same as getLightSRGBColor() - LLColor3 getLightColor() const { return getLightSRGBColor(); } + LLColor3 getLightSRGBBaseColor() const; - // Same as linearColor3(getLightSRGBColor) + // Get the light color in linear color space NOT scaled by intensity. + LLColor3 getLightLinearBaseColor() const; + + // Get the light color in linear color space scaled by intensity + // this is the value that should be fed into shaders LLColor3 getLightLinearColor() const; // Get the light color in sRGB color space scaled by intensity. -- cgit v1.2.3 From 516ca236597e9e76193dd597edddc6a2fd7b0912 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 30 Mar 2020 23:27:04 -0400 Subject: Update falloff fix with changes requested in review. --- indra/newview/llvovolume.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.h') diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 776b6a16b0..de00ef494e 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -279,7 +279,7 @@ public: LLViewerTexture* getLightTexture(); F32 getLightIntensity() const; F32 getLightRadius() const; - F32 getLightFalloff() const; + F32 getLightFalloff(const F32 fudge_factor = 1.f) const; F32 getLightCutoff() const; // Flexible Objects -- cgit v1.2.3