Update to SABR v3.0.
authorTim Allen <screwtape@froup.com>
Thu, 22 Nov 2012 10:45:33 +0000 (21:45 +1100)
committerTim Allen <screwtape@froup.com>
Thu, 22 Nov 2012 10:45:33 +0000 (21:45 +1100)
commitd775c04a0280f6cba4bfd4805b4a5e164dc41a1e
tree8bc22aa3a23ff2048e98407b02609cb779394228
parent3051e55f5deee7dd88ffaf3f74c6ee470d31d1c7
Update to SABR v3.0.

joshuass says:

    Been busy working on a way to remove the final bits of branching
    (assuming the built in step function isn't a branch itself).

    I removed the branching by calculating a set of booleans for each
    interpolation result at the four corners in a way that only allows
    a corner to have one of its interpolation values be true.

    Then, by casting, I can multiply and sum all the interpolation
    amounts and rules in a single pass rather than using the if/else and
    ternary statements.

    Finally, to get rid of the final artifacts due to using all corners
    to determine a texel's color, I am calculating the values twice. One
    time by going counter clockwise, and one time going clockwise. Then
    I select the value that is the furthest from the texel's original
    value through a step/mix function combination.

    It works incredibly well! I just hope that it also makes it
    speedier.
shaders/OpenGL/v1.0/SABR.shader