3 ms·
Texture sampling is still performed with specialized hardware. It does bilinear or trilinear sampling, which would be "wrong" by the original article's definiti
by jckarter 16y ago
Texture sampling is still performed with specialized hardware. It does bilinear or trilinear sampling, which would be "wrong" by the original article's definition.
- miloshh 16y agoYes, but I think the GPU designers did the right thing here by not injecting "magic" gamma-correction functionality into the texture sampler. There are many operations done on textures before they become pixel colors, plus they are often used to store non-image information (positions, normals, CT densities) where gamma correction would be incorrect.If you care about correct tone-mapping (most games probably don't), you can correct your textures beforehand.
- jckarter 16y agoOh, I agree entirely. I just called it "wrong" in response to Geee's original question. Should have clarified.
- ssp 16y agoBasically all newer hardware has the ability to convert from sRGB to linear RGB during texture sampling, and back again during ROP. See these OpenGL extensions: http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.tx...
- jckarter 16y agoIs the sRGB-to-linear transformation actually done in the GPU's texturing hardware? nVidia's PTX ISA at least doesn't expose any sRGB-specific sampling opcodes.
- ssp 16y agoThe conversion should take place before filtering, so it has to be in the texturing hardware. There is no need for sRGB specific sampling opcodes because sRGB is considered a property of the texture, not of the way you sample it.
- jckarter 16y agoYeah, but PTX doesn't give texture or sampler values an sRGB mode either. Are you sure the driver doesn't just convert the texture when glTex(Sub)Image* is called?
- deleted 16y ago[deleted]
- ssp 16y agoI would be very surprised. I do know that both Intel and ATI chips support it in texture hardware. See this, for example: http://www.x.org/docs/AMD/R5xx_Acceleration_v1.5.pdf http://www.x.org/docs/AMD/R5xx_Acceleration_v1.5.pdf Bit 21 of TXFORMAT0: GAMMA 21 none Optionally remove gamma from texture before passing to shader. Only apply to 8bit or less components. POSSIBLE VALUES: 00 - Disable gamma removal 01 - Enable gamma removal There is also support for re-applying gamma before storing to a color buffer.