Difference between revisions of "LlLinear2sRGB"

From Second Life Wiki
Jump to navigation Jump to search
m (Add misnomer note & reference links.)
m
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:
The sRGB (Standard Red Green Blue) colorspace is defined in [https://www.color.org/srgb04.xalter IEC 61966-2-1:1999] and was developed as a joint project between Microsoft and HP.
The sRGB (Standard Red Green Blue) colorspace is defined in [https://www.color.org/srgb04.xalter IEC 61966-2-1:1999] and was developed as a joint project between Microsoft and HP.


This calculation is known as an Inverse Electro-Optical Transfer Function (EOTF).
This calculation is known as an Inverse Electro-Optical Transfer Function (IEOTF).


|caveats=
|caveats=
*The name of this function is actually a misnomer as LSL color is actually in [https://www.color.org/chardata/rgb/BT709.xalter Rec.709] space, not [https://www.color.org/chardata/rgb/srgb.xalter sRGB] space. While they are very similar, the gamma value for sRGB is approx. 2.2, whereas the gamma value for Rec.709 is approx. 2.4.
*The name of this function is actually a misnomer as LSL color is actually in [https://www.color.org/chardata/rgb/BT709.xalter Rec.709] space, not [https://www.color.org/chardata/rgb/srgb.xalter sRGB] space. While they are very similar, the gamma value for sRGB is approx. 2.2, whereas the gamma value for Rec.709 is approx. 2.4.
*Scripting for PBR-enabled viewers: If you enter color vectors manually, using the viewer's color picker, enter them as Linear RGB values. The color picker automatically converts them internally to sRGB, so someone using a PBR-enabled viewer will see them correctly. This means that if you are defining colors with a script, the same is true. You do not need to use llLinear2sRBG to convert your color vectors and apply them separately for PBR.
|examples
|examples
|helpers
|helpers

Latest revision as of 12:07, 12 December 2024

Summary

Function: vector llLinear2sRGB( vector color );

Returns a vector Transforms a color specified in linear RGB colorspace into the sRGB colorspace.

• vector color Color in the linear color space.

Specification

Lights in Second Life are specified in LSL as linear red, green blue values in the range (0.0, 1.0). Internally light calculations are performed in the sRGB colorspace.

The sRGB (Standard Red Green Blue) colorspace is defined in IEC 61966-2-1:1999 and was developed as a joint project between Microsoft and HP.

This calculation is known as an Inverse Electro-Optical Transfer Function (IEOTF).

Caveats

  • The name of this function is actually a misnomer as LSL color is actually in Rec.709 space, not sRGB space. While they are very similar, the gamma value for sRGB is approx. 2.2, whereas the gamma value for Rec.709 is approx. 2.4.
  • Scripting for PBR-enabled viewers: If you enter color vectors manually, using the viewer's color picker, enter them as Linear RGB values. The color picker automatically converts them internally to sRGB, so someone using a PBR-enabled viewer will see them correctly. This means that if you are defining colors with a script, the same is true. You do not need to use llLinear2sRBG to convert your color vectors and apply them separately for PBR.

Examples

See Also

Functions

•  llsRGB2Linear To convert from sRGB to the Linear colorspace. (EOTF)

Deep Notes

Signature

function vector llLinear2sRGB( vector color );