sRGB -> linear conversion
| 590 | |
| 591 | // sRGB -> linear conversion |
| 592 | inline Float3 SRGBToLinear(Float3 color) |
| 593 | { |
| 594 | Float3 x = color / 12.92f; |
| 595 | Float3 y = Pow((color + 0.055f) / 1.055f, 2.4f); |
| 596 | |
| 597 | Float3 clr = color; |
| 598 | clr.x = color.x <= 0.04045f ? x.x : y.x; |
| 599 | clr.y = color.y <= 0.04045f ? x.y : y.y; |
| 600 | clr.z = color.z <= 0.04045f ? x.z : y.z; |
| 601 | |
| 602 | return clr; |
| 603 | } |
| 604 | |
| 605 | inline float ComputeLuminance(Float3 color) |
| 606 | { |