Search code examples
c++openglcolor-spacesrgb

sRGB, assimp and textures


  1. I'm using assimp to load my various 3d models I've found around the internet to lab with. From reading assimp docs, it dosn't seem to say anything about linear/non-linear colorspaces. Can I assume the loaded models are in one space or another?

  2. I'm using a deferred renderer. It kinda works like this:

    1. Geometry stage - Render geometry to textures (position/normals/diffuse)
    2. Shading stage - all output is rendered & blended into a "final texture"
      1. Render ambient light
      2. Render directional lights and shadows
      3. Render point lights and shadows
    3. BlitFramebuffer() on the final texture
    4. Swapbuffers and repeat 1.

I've read about having srgb textures and srgb framebuffers... should my "final texture", which ultimately is blitted onto the back buffer, be of "sRGB" format? If not, which textures should it be? Would that "automatically" give me sRGB-correct graphics?


Solution

  • Bring in linear space textures and then render the viewport as sRGB with glEnable(GL_FRAMEBUFFER_SRGB).

    Look at this guide for more.