Skip to content

Instantly share code, notes, and snippets.

@tomaka
Created August 7, 2017 08:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaka/0ef19530fdbf6a1d30ebf9c0bcd0df72 to your computer and use it in GitHub Desktop.
Save tomaka/0ef19530fdbf6a1d30ebf9c0bcd0df72 to your computer and use it in GitHub Desktop.
Non-linear sRGB to linear sRGB
vec3 srgb_to_linear(vec3 c) {
return mix(c / 12.92, pow((c + 0.055) / 1.055, vec3(2.4)), step(0.04045, c));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment