Search Unity

Accessing average screen color or brightness through Post Processing ?

Discussion in 'High Definition Render Pipeline' started by alexandre-fiset, Jan 29, 2021.

  1. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    The contrast of our indoor-outdoor game causes our UI to be either too light or too dark for the context.

    What I'd like to do is to change the color based on the current "brightness" of the screen. I've found many ways to achieve that, but all of them are costly GetPixel methods.

    Is there a value somewhere in the PostProcessing stack, such as in the AutoExposure component or something like that, that I could retrieve by script to dim my UI?
     
  2. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    I think the value you are looking for is the current exposure. I don't know how to get that value, but if I where trying to find it, I would search around in the HDRP source code for when the value is handed over to the shaders who needs it. So just search the HDRP source code for "exposure" maybe?

    I might be wrong on this, but that is how I would try to solve it.