Skip to content

Instantly share code, notes, and snippets.

@ikrima
Created February 28, 2014 00:15
Show Gist options
  • Save ikrima/9262567 to your computer and use it in GitHub Desktop.
Save ikrima/9262567 to your computer and use it in GitHub Desktop.
half3 fromRGBM(half4 c) {
#ifdef MARMO_LINEAR
//RGB is pulled to linear space by sRGB sampling, alpha must be in linear space also before use
//BUG?? Shouldn't this be toLinearFast1(c.a)*51.5
return c.rgb * toLinearFast1(c.a);
#else
//leave RGB*A in gamma space, gamma correction is disabled
return c.rgb * c.a;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment