Created
December 1, 2019 14:56
-
-
Save paniq/57f5ddf3bf4b1b24a29d5d66a14043a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn... linear->sRGB | |
case (x : f32,) | |
mix | |
1.055 * (x ** (1.0 / 2.4)) - 0.055 | |
12.92 * x | |
step x 0.0031308 | |
case (x : vec3,) | |
mix | |
1.055 * (x ** (vec3 (1.0 / 2.4))) - 0.055 | |
12.92 * x | |
step x (vec3 0.0031308) | |
fn... sRGB->linear | |
case (x : f32,) | |
mix | |
((x + 0.055) / 1.055) ** 2.4 | |
x / 12.92 | |
step x 0.04045 | |
case (x : vec3,) | |
mix | |
((x + 0.055) / 1.055) ** (vec3 2.4) | |
x / 12.92 | |
step x (vec3 0.04045) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment