sRGB -> linear conversion
| 638 | |
| 639 | // sRGB -> linear conversion |
| 640 | inline Float3 SRGBToLinear(Float3 color) |
| 641 | { |
| 642 | Float3 x = color / 12.92f; |
| 643 | Float3 y = Pow((color + 0.055f) / 1.055f, 2.4f); |
| 644 | |
| 645 | Float3 clr = color; |
| 646 | clr.x = color.x <= 0.04045f ? x.x : y.x; |
| 647 | clr.y = color.y <= 0.04045f ? x.y : y.y; |
| 648 | clr.z = color.z <= 0.04045f ? x.z : y.z; |
| 649 | |
| 650 | return clr; |
| 651 | } |
| 652 | |
| 653 | inline float ComputeLuminance(Float3 color) |
| 654 | { |