Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Bugs in fill_outline shader #8751

Closed
Closed

Description

@jfirebaugh

The fragment shader does smoothstep(1.0, 0.0, dist). But smoothstep's behavior is undefined when its first argument is >= its second argument. On macOS, it appears that the result is always 0.

Changing it to smoothstep(0.0, 1.0, dist) also doesn't work -- except for a band across the middle of the screen, the result value is always 1.0.

Using the following shader modification, you can see it's calculating the distance from the a horizontal line through the center of the viewport, rather than the desired value:

    float alpha = dist / 100.0;
    gl_FragColor = vec4(alpha, alpha, alpha, 1.0);

image

cc @kkaefer @ansis

Activity

  1. added
    Core
    on Apr 15, 2017
  2. kkaefer commented on Apr 18, 2017

    @kkaefer
    Member

    Looks like this was broken from the very beginning: mapbox/mapbox-gl-js@63e9f71#diff-97267ac172ce8fd831ea9c2993add6a6R9

  3. kkaefer commented on Apr 18, 2017

    @kkaefer
    Member

    This is almost certainly the culprit for #1555

  4. kkaefer commented on Apr 18, 2017

    @kkaefer
    Member

    On macOS, it appears that the result is always 0.

    How did you reach that conclusion? I'm seeing different results (no antialiasing) when manually setting float alpha = 0.0.

  5. jfirebaugh commented on Aug 7, 2017

    @jfirebaugh
    ContributorAuthor

    Fixed in #9699.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions