20180126 - Less Wrong UNORM Box Filter
When going for the traditional LDR MSAA box filter look,
wanting to preserve the perceptual 4 or 8 step gradient on edges,
but wanting have correct color of linear blending...
Technique is easy,
Problem solved: horrid box filter look without the non-linear color artifacts.
- Take an sRGB view of your UNORM MSAA surface as input to a custom resolve
- Write to an sRGB view of your UNORM non-MSAA output surface in the custom resolve
- Convert all samples to luma
- Get linear box average
- Convert lumas from linear to perceptual
- Take box average of perceptual luma (this is the desired perceptual gradient)
- Convert desired luma back to linear
- Scale the linear box average of sample color by 'linear desired luma / linear box average'
Just like standard perceptual MSAA box resolve, the output is not energy conserving.
Random Stuff on Interwebs
Reed's Blog List