Could anyone offer up a method to estimate the brightness level of the screen that is displaying your game. I understand there are some formulas that incorporate rbg data to estimate luminosity levels, but I’m having trouble finding a simple solution for capturing the rbg data for all pixels and thought someone might have some insights on a concise way to do something like convert the screen to a Texture2D and calculate the brightness based on that texture data.
Thanks.
We used to do something similar for older consoles to work out sun bloom effects.
If you’re rendering your screen to a render texture (e.g. 512x512) you can write some code that progressively renders it to smaller and smaller render textures (e.g. 512x512 to 256x256, 256x256 to 128x128) until you end up with a 1x1 or very small texture. Because the bilinear process averages the colours during each render you end up with a colour value that represents the overall screen colour.