Search Unity

Is there a way to change the back buffer format?

Discussion in 'General Graphics' started by wetstreet, Sep 13, 2021.

  1. wetstreet

    wetstreet

    Joined:
    Jan 23, 2019
    Posts:
    7
    I noticed that in Gamma Workflow the backbuffer is in RGBA8_UNorm format, which means that there is no color space conversion being done when writing into the backbuffer. While in Linear Workflow the backbuffer is in RGBA8_SRGB format, which means that the output of the fragment shader will be converted to Gamma Space before writing into the backbuffer, which cancels out the conversion from Gamma Space to Linear Space when sampling color textures with sRGB checkbox ticked.
    So in Linear Workflow non-transparent UI textures look fine, but with blending the result does not look the same compared with Gamma Workflow (I assume that blending happens before color space conversion, which possibly explains this phenomenon).
    As far as I know there are two ways to make UI in unity linear workflow to look the same as in photoshop:
    1.create a new render texture in non srgb format, and render UI textures to that rt.
    2.change photoshop to linear space and re-adjust all the textures.
    The second one may be better performance-wise, but if I can change the backbuffer format then no extra works needs to be done. That'd be perfect.
    Or maybe I should use the gamma workflow and do the color space conversion in my shaders?
     
    cqarthur likes this.