Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I use GL_SRGB8 instead of GL_RGB8?

Tags:

opengl

srgb

With respect to RGB and sRGB, are the following understandings I have (or not) true?

  1. I read an authored image (a .png) into a GL_SRGB8 format texture.
    • (q) When sampling the texture from (1) the hardware will convert from sRGB to linear colour space?
  2. I read an authored image into a GL_RGB8 texture.
    • (q) When sampling the texture from (2) the hardware will not convert from sRGB to linear?
  3. I set GL_FRAMEBUFFER_SRGB to true at the final stage of my pipeline.
    • (q) When displaying the back buffer the hardware will convert from linear to sRGB colour space?
  4. I have a pipeline with 5 stages, each writing to a floating point texture (GL_RGBA16F)
    • (q) The whole pipeline is linear until the final stage, provided (1) and (3) are true.
like image 520
Robinson Avatar asked Jul 16 '14 13:07

Robinson


1 Answers

Essentially yes to all of them. However (3) has an additional constraint: For a framebuffer to do linear RGB to sRGB conversion, the color attachment must be in SRGB format itself, i.e. be a sRGB texture, renderbuffer or a main window with a sRGB pixelformat.

like image 60
datenwolf Avatar answered Dec 23 '22 20:12

datenwolf