Closed GoogleCodeExporter closed 9 years ago
Original comment by cast...@gmail.com
on 21 Mar 2008 at 8:32
As suggested in this thread:
http://developer.nvidia.com/forums/index.php?showtopic=1399
it would be great to support not only the XBox-360 gamma curve, but also the
standard
IEC sRGB curve.
The formula for the conversion to linear to sRGB is:
if (isnan(cl)) {
/* Map IEEE-754 Not-a-number to zero. */
cs = 0.0;
} else if (cl > 1.0) {
cs = 1.0;
} else if (cl < 0.0) {
cs = 0.0;
} else if (cl < 0.0031308) {
cs = 12.92 * cl;
} else {
cs = 1.055 * pow(cl, 0.41666) - 0.055;
}
and the inverse:
{ cs / 12.92, cs <= 0.04045
cl = {
{ ((cs + 0.055)/1.055)^2.4, cs > 0.04045
See:
http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt
Original comment by cast...@gmail.com
on 6 Apr 2008 at 9:44
This is implemented now in trunk.
Original comment by cast...@gmail.com
on 28 Oct 2010 at 5:46
Original issue reported on code.google.com by
cast...@gmail.com
on 21 Mar 2008 at 8:31