Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved RenderTexture's color look washed out

Discussion in 'General Graphics' started by pablobandinopla, Aug 22, 2023.

  1. pablobandinopla

    pablobandinopla

    Joined:
    Jul 2, 2021
    Posts:
    97
    On the left is the color as i see it on the scene view, on the right, it is the camera's view rendered to a texture. It looks washed out, i dont know why. Anyone knows?


    upload_2023-8-22_5-56-55.png

    upload_2023-8-22_5-58-37.png
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    625
    Hi, have you tried changing the color format of render texture to an HDR format (like B10G11R11, R16G16B16A16)?
     
  3. pablobandinopla

    pablobandinopla

    Joined:
    Jul 2, 2021
    Posts:
    97
    In HDRP, all render textures are rendered in linear color space by default. This is because HDRP uses a linear workflow, which means that all colors are stored and processed in a linear way.
    Solution was to apply a gamma correction to the renderedTexture. Basically do a POW on the color with value 2.2.

    upload_2023-8-22_8-37-32.png
     
  4. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    547
    Try picking a SRGB texture format which will do the same thing, just in hardware.
     
  5. pablobandinopla

    pablobandinopla

    Joined:
    Jul 2, 2021
    Posts:
    97
    which option here is SRGB?? i tried a bunch and without the POW i get washed out colors...

    upload_2023-8-23_8-39-12.png
     
  6. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    547
    The very first one at the top (R8G8B8A8_SRGB). But that's assuming that you are not rendering in HDR or that there is a tonemapping pass which converts from HDR to SDR. Floating point (HDR) formats are always linear.
     
  7. pablobandinopla

    pablobandinopla

    Joined:
    Jul 2, 2021
    Posts:
    97
    yeah it didn't worked. Im using HDRP with linear color space.
    After further investigation, it seems that when you use linear, Unity does make the convertion to sRGB automatically, but since im using that renderTexture on a fullscreen volume pass, im plotting it again on screen, which is apparently taking an image in sRGB, asuming it is in linear space and then the convertion is done from linear to sRGB but the image was not in linear mode it was in sRGB...

    so doing POW 2.2 actually is doing gamma decoding into linear space that's why it seems to fix my issue...

    to put context, i have a camera that is rendering 3d elements into a renderTexture then plotting that in a full screen pass to create a menu system like in the game tomb raider 1~3

    upload_2023-8-23_11-9-46.png
     
    c0d3_m0nk3y likes this.