Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pathfinder's more accurate area approximation for distance AA. #2445

Merged
merged 2 commits into from Feb 22, 2018

Commits on Feb 22, 2018

  1. Use Pathfinder's more accurate area approximation for distance AA.

    Smoothstep is not a very good approximation because it has zero
    derivatives at 0.0 and 1.0. It makes edges too sharp (i.e. more
    aliased).
    
    From the comments in `prim_shared.glsl`:
    
    This cubic polynomial approximates the area of a 1x1 pixel square under a
    line, given the signed Euclidean distance from the center of the square to
    that line. Calculating the *exact* area would require taking into account
    not only this distance but also the angle of the line. However, in
    practice, this complexity is not required, as the area is roughly the same
    regardless of the angle.
    
    The coefficients of this polynomial were determined through least-squares
    regression and are accurate to within 2.16% of the total area of the pixel
    square 95% of the time, with a maximum error of 3.53%.
    pcwalton authored and gw3583 committed Feb 22, 2018
  2. Update Linux-specific reftests

    gw3583 committed Feb 22, 2018
You can’t perform that action at this time.