Best way to get average color/brightness values for the current frame?
I'm trying to get a color value which is representative of the color and/or brightness value of the current frame.
I tried pulling the colors of sample pixels from the OS and averaging them using FPlatformMisc::GetScreenPixelColor, but it was extremely slow. Sampling just 100 pixels caused significant hitch of around half a second.
I tried a 2DSceneCapture actor rendering to a very low-res texture, but the results weren't consistent and a this is a VR application I almost certainly can't afford rendering the scene again.
I was thinking that the data for brightness might be available from the AutoExposure post process, but I dug into that and nothing seemed especially applicable - the AutoExposure values tend to hit thresholds and then change dramatically, which makes them unsuitable for this.
I tried the same thing via FViewport::ReadPixelsPtr, but apparently the Viewport is only valid while it's being drawn to, which means I'd need a custom UGameViewportClient to spit out the data as it draws. This is... doable, but I wanted to know if anyone knew of any better options before I take that drastic a step.
Is there a better way of going about doing this? In the "future features" part of the recent 4.11 preview, a "pixel picker" to query the renderer about pixels on demand was mentioned, but it sounded like it was a long ways off.
Follow this question
Once you sign in you will be able to subscribe for any updates here