Skip to content
  • Niklas Haas's avatar
    shaders: major refactor of tone mapping and color spaces · 7aa14ac3
    Niklas Haas authored
    This accomplishes several things:
    
    1. vec4 colors are now explicitly always normalized such that 1.0 is the
       reference white, and out-out-range values are used to communicate
       high dynamic range images. This makes a lot of processing steps
       saner, and doesn't matter much in the end. It also makes better use
       of the dynamic range of a float FBO, which is better for
       representational efficiency than linear FBOs either way.
    
    2. HDR metadata now includes the frame average light level, not just the
       signal peak. This is important because it allows us to linearly
       darken over-bright scenes, which are sadly common due to shit
       mastering.
    
    3. The tone mapping code takes into account the desired target peak and
       frame average light level. Not strictly necessary, but could be
       useful to play around with; especially for PQ output.
    
    4. The peak detection SSBO code is fundamentally fixed. This had a large
       number of issues, too many to even bother listing. Now it should
       actually work properly.
    7aa14ac3