Skip to content

Instantly share code, notes, and snippets.

@phi-lira
Last active June 17, 2019 10:29
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 phi-lira/af7081f815b7fdf3dd1c to your computer and use it in GitHub Desktop.
Save phi-lira/af7081f815b7fdf3dd1c to your computer and use it in GitHub Desktop.
// As seen on https://gamedevdaily.io/the-srgb-learning-curve-773b7f68cf7a
float D3DX_FLOAT_to_SRGB(float val)
{
if( val < 0.0031308f )
val *= 12.92f;
else
val = 1.055f * pow(val,1.0f/2.4f) — 0.055f;
return val;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment