summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-28 19:14:00 -0500
committerDave Parks <davep@lindenlab.com>2022-09-28 19:14:00 -0500
commit2e499bcc40871b6a68700203cc83fe7d81c79c24 (patch)
tree5204d535fb875bc65f2278aa1be19ad1da54fd73 /indra/llmath
parent2f082bb4ee433cba857499559dbfb30886fd0fb4 (diff)
SL-18190 Prune srgb_to_linear from atmosphericsFuncs.glsl
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/v3color.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h
index 43a632408c..c3c6ae2242 100644
--- a/indra/llmath/v3color.h
+++ b/indra/llmath/v3color.h
@@ -484,13 +484,23 @@ inline const LLColor3 srgbColor3(const LLColor3 &a) {
return srgbColor;
}
-inline const LLColor3 linearColor3(const LLColor3 &a) {
+inline const LLColor3 linearColor3(const F32* v) {
LLColor3 linearColor;
- linearColor.mV[0] = sRGBtoLinear(a.mV[0]);
- linearColor.mV[1] = sRGBtoLinear(a.mV[1]);
- linearColor.mV[2] = sRGBtoLinear(a.mV[2]);
+ linearColor.mV[0] = sRGBtoLinear(v[0]);
+ linearColor.mV[1] = sRGBtoLinear(v[1]);
+ linearColor.mV[2] = sRGBtoLinear(v[2]);
return linearColor;
}
+template<class T>
+inline const LLColor3 linearColor3(const T& a) {
+ return linearColor3(a.mV);
+}
+
+template<class T>
+inline const LLVector3 linearColor3v(const T& a) {
+ return LLVector3(linearColor3(a.mV).mV);
+}
+
#endif