Code Monkey home page Code Monkey logo

Comments (8)

mmastrac avatar mmastrac commented on July 23, 2024

I took some screenshots of larger busted glyphs to illustrate the problem (and hopefully suggest what the failure mode might be). Small glyphs break in a different way. The failure mode changes somewhere around font size 72 (instead of being completely busted, the fonts are somewhat recognizable), suggesting 1 inch as some magic factor.

screen shot 2017-11-27 at 10 47 34 am

screen shot 2017-11-27 at 10 47 46 am

screen shot 2017-11-27 at 10 47 53 am

screen shot 2017-11-27 at 10 48 00 am

screen shot 2017-11-27 at 10 48 07 am

from pathfinder.

mmastrac avatar mmastrac commented on July 23, 2024

Example of transition from font size 72 to font size 73, using Open Sans:

O

screen shot 2017-11-27 at 10 52 57 am

screen shot 2017-11-27 at 10 53 00 am

B

screen shot 2017-11-27 at 10 53 07 am

screen shot 2017-11-27 at 10 53 10 am

1

screen shot 2017-11-27 at 10 53 17 am

screen shot 2017-11-27 at 10 53 20 am

X

screen shot 2017-11-27 at 10 53 25 am

screen shot 2017-11-27 at 10 53 28 am

from pathfinder.

trishume avatar trishume commented on July 23, 2024

I also have a 2014 rMBP. I've experienced artifacts, although I don't remember if they were like these, at varying times. I would try to replicate but I actually can't build Pathfinder right now because fontsan depends on an old miniz-sys that doesn't compile on my machine with the error could not find native static library 'miniz', perhaps an -L flag is missing?.

from pathfinder.

mmastrac avatar mmastrac commented on July 23, 2024

I fiddled with some of the shaders to no avail but I strongly suspect a driver bug in computeCoverage. I tried rearranging some of the code to remove conditionals, but nothing really helped.

Changing a2x to p0X.x + dPX.x when slopeIsNegative is false moves the artifacts in an interesting way that suggests that this method could be the the culprit:

     } else {
-        a2x = p0X.x;
+        a2x = p0X.x + dPX.x;
         a0 = p1;
         a1 = p0;
     }

Before that change:

screen shot 2017-11-27 at 10 47 34 am

After that change:

screen shot 2017-11-27 at 1 45 45 pm

from pathfinder.

pcwalton avatar pcwalton commented on July 23, 2024

If anyone can bisect this change down, that would be very helpful. (I can't reproduce, obviously…)

from pathfinder.

trishume avatar trishume commented on July 23, 2024

I bisected it and found 7bd3a48 is the first bad commit for the new artifact. It's parent 6d85cb3 works. There also was an old artifact that I ended up bisecting in order to find a good commit for the new bisect, so that info is in the log below as well.

8897145f54f6ca5c88983cd362f429c2ae29460b old artifact
77fa297380799e467f293d36ad8208334dbc159a old artifact
092b46e056dd17360078d52c7d60e28bc42cd4d2 good
81787f4750031976056b44819c0cdf0cd4e4e8ef old artifact
6a7c013e617cc0287f17630a6c30aeeccb0f9192 good
314185684cb5995c26bb0b4a33878ee50e9e648c old artifact
c2368bb71edcc9f806ed7b2002841f4737c5c5fb good
3352f869f0a921e1c3e942a8dae2cf5cd39a3e43 good
314185684cb5995c26bb0b4a33878ee50e9e648c is the first bad commit for the old artifact

2e90b3bce8db697052a1f17da670ebe76f34f874 no text at all
86df78f939c944df9da1f8c282dd8d3679947f4f good
5a1e4d4e606a2ec6617bdcfc0735133d966856d9 good
99c7e685e785b0a38ad2d30bd0650f3a76bbc943 good
7bd3a481105fa9f20bafbcfba6b9ed1cc1e7f573 is the first bad commit for the new artifact

d65bfb7fb20fffba15aa5203c26caa6d3794cd2e old artifact
86df78f939c944df9da1f8c282dd8d3679947f4f good
5a1e4d4e606a2ec6617bdcfc0735133d966856d9 good
99c7e685e785b0a38ad2d30bd0650f3a76bbc943 good
6d85cb338243a5f637aa829c45ef9a83927979b1 good

from pathfinder.

trishume avatar trishume commented on July 23, 2024

I did some debugging and the artifacts are the exact same as if I remove the early return in computeCoverage: https://github.com/pcwalton/pathfinder/blob/7bd3a481105fa9f20bafbcfba6b9ed1cc1e7f573/shaders/gles2/common.inc.glsl#L263

and run it on my Iris Pro, which usually works. So it seems somehow the Apple Nvidia GPU shader compiler isn't compiling that early return properly.

Further, if I add a return 1.0 to the first branch of the following if statement, the early return starts working again and I get results that look reasonable except negatively sloped edges are aliased.

from pathfinder.

mmastrac avatar mmastrac commented on July 23, 2024

Confirmed fixed. Looks beautiful.

For posterity, the GPU/CUDA version on my machine:

image

from pathfinder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.