Closed igv closed 1 year ago
Thanks!
I'm travelling right now and I don't have access to my computer, but I'll check this out as soon as I can.
As you've noticed the problem with the shader is that the math is very unstable and values tend to explode, and I didn't really want to pursue the idea further because it was looking like too much of a hack.
Ok, I could look at this briefly.
From my admittedly very limited tests, it looks like limiting the denominators essentially solves the "values tend to explode" problem, which in turn makes the AR-style clamping unnecessary. Numbers seem a bit better doing this but I can't say the visual difference is meaningful.
The only thing I don't understand is why you'd include an extra top-left pixel (fp + vec2(-0.5, -0.5))
.
The same solution doesn't work nearly as well in the 4-tap variant, values can still easily go to the wrong direction due to the steepness of the slope (red to green transitions for example).
I think these shaders can still be improved in other ways too. I could try adding a luma downscaling step, or figure out a better way to handle the correlation-based mixing (right now it's just corr / 2.0
, which probably isn't ideal). This will probably have to wait until I'm back home in ~3 weeks though.
Updated the shaders with some of the suggestions. Thanks again =)