Fixes:
* Values exceeding the encoded range.
Future may account for a certain range
above and below current values.
* Minor calculation problem that prevented
the above fix from working properly.
* Streamlined the shader code.
* Add a vertex shader to handle the scaling.
* Use the viewport resolution as the scaled
version to save performance.
Basic pass at histogram. Uses a power based
scale compared against the total pixel count.
Probably needs a UI toggle to flip lines on
and off as the text and lines in OpenGL are
a large cycles sucker. Could be likely much
faster when migrated to a geometry shader
approach. Uses the scaled viewport resolution
to increase performance as much as possible.
Remove the sum, add some commments, and
make it scale to the full window.
TODO:
* Hook up CM.
* Add UI for intensity
* Add lines at 20% increments, plus under /
overshoot?
* Add UI for increments.
Props to @samirosman for spotting the typo in the comment
describing the proper luma / luminance weighting coefficient
for the blue REC.709 primary. Updated the other slippery "RGB"
terms to more properly reflect the assumptions.
While still not colour managed, and grossly assuming REC.709
display referred buffers, the effect as it currently stands can be
improved to use the proper coefficients for REC.709, as opposed
to legacy REC.601. Ideally there'd be a flag somewhere to flip between
the two coefficient sets.