My project involves a custom post-processing pipeline that chains together lots of custom shader post-processes. One of the last steps is a Photoshop-style brightness & contrast shader. Before I run that I’d like to get the pixels from the previous post-process’s render target and analyze those to determine the average, min, and max luminance in the image, to set the best brightness/contrast levels.
Does anyone know the simplest way to read those pixels during the pipeline sequence, and (hopefully) analyze them before the next postprocess starts? It’s been a lot of trial and error but no success yet. I’ve gone down rabbit holes learning about multi render targets, PostProcess.onActivate, PrePassRenderers and so on – but I think I might be overcomplicating things.
I created the following PG example that’s a bit like the custom pipeline (just combined some existing examples): https://playground.babylonjs.com/#QCGFI6#33
Thanks in advance for any ideas!