Asmodeus
2005-08-22, 14:08:56
Hab ich einen Thread dazu einfach übersehen, oder ist diese Tatsache doch nicht so von Bedeutung, dass sie hier nicht besprochen wird. :wink:
GL_EXT_texture_sRGB:
Link zur Extension (http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_sRGB.txt)
...
Implemented by NVIDIA's Release 80 driver series for GeForce FX
(NV3x), GeForce 6 and 7 Series (NV4x and G7x), and Quadro FX (NV3xGL,
NV4xGL, G7xGL).
...
...
13) Does this extension imply filtered results from sRGB texture
have more than 8 bits of precision?
RESOLVED: Effectively, yes.
8-bit components of sRGB texels are converted to linear RGB values
which requires more than 8 bits to avoid lose of precision.
This implies the filtering involve more than 8 bits of color
precision per component. Moreover, fragment color (whether by
a fragment program, vertex program, or glTexEnv modes) should
operate at precision beyond 8 bits per color component.
The exact precision maintained (and its distribution) is left to
implementations to define but returning at least 12 but more
likely 16 linear bits per component, post-filtering, is a
reasonable expectation for developers.
This extension assumes fragment coloring is performed.
14) What must be specified as far as how do you convert to and from
sRGB and linear RGB color spaces?
RESOLVED: The specification language needs to only supply the
sRGB to linear RGB conversion (see section 3.8.x below).
For completeness, the accepted linear RGB to sRGB conversion
(the inverse of the function specified in section 3.8.x) is as
follows:
Given a linear RGB component, cl, convert it to an sRGB component,
cs, in the range [0,1], with this pseudo-code:
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;
}
sRGB components are typically stored as unsigned 8-bit
fixed-point values. If cs is computed with the above
pseudo-code, cs can be converted to a [0,255] integer with this
formula:
csi = floor(255.0 * cs + 0.5)
...
Gruss, Carsten.
GL_EXT_texture_sRGB:
Link zur Extension (http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_sRGB.txt)
...
Implemented by NVIDIA's Release 80 driver series for GeForce FX
(NV3x), GeForce 6 and 7 Series (NV4x and G7x), and Quadro FX (NV3xGL,
NV4xGL, G7xGL).
...
...
13) Does this extension imply filtered results from sRGB texture
have more than 8 bits of precision?
RESOLVED: Effectively, yes.
8-bit components of sRGB texels are converted to linear RGB values
which requires more than 8 bits to avoid lose of precision.
This implies the filtering involve more than 8 bits of color
precision per component. Moreover, fragment color (whether by
a fragment program, vertex program, or glTexEnv modes) should
operate at precision beyond 8 bits per color component.
The exact precision maintained (and its distribution) is left to
implementations to define but returning at least 12 but more
likely 16 linear bits per component, post-filtering, is a
reasonable expectation for developers.
This extension assumes fragment coloring is performed.
14) What must be specified as far as how do you convert to and from
sRGB and linear RGB color spaces?
RESOLVED: The specification language needs to only supply the
sRGB to linear RGB conversion (see section 3.8.x below).
For completeness, the accepted linear RGB to sRGB conversion
(the inverse of the function specified in section 3.8.x) is as
follows:
Given a linear RGB component, cl, convert it to an sRGB component,
cs, in the range [0,1], with this pseudo-code:
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;
}
sRGB components are typically stored as unsigned 8-bit
fixed-point values. If cs is computed with the above
pseudo-code, cs can be converted to a [0,255] integer with this
formula:
csi = floor(255.0 * cs + 0.5)
...
Gruss, Carsten.