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

Increase fill_extrusion base/height precision. #7292

Merged
merged 1 commit into from
Sep 18, 2018
Merged

Conversation

ChrisLoer
Copy link
Contributor

@ChrisLoer ChrisLoer commented Sep 18, 2018

Fixes issue #7247: heights over 65,536 meters don't render on some devices (tested against iOS Safari). We were using the lowp precision qualifier for the fill-extrusion-base and fill-extrusion-height attributes. GLSL allows implementations to use really low precision (and small range) for lowp floats, although most implementations don't go down to the limits.

See discussion in issue #2096: as a rule of thumb we want to standardize on using highp precision qualifiers in our shaders unless there's a specific reason we know (1) low precision won't break anything we depend on, and (2) low precision is likely to be a useful performance optimization.

I tested this against a simple "landcover" extrusion layer set to 70,000 meters on iOS 11 Safari running on an iPhone 8.

Before:
image from ios 1

After:
image from ios

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality (Failing test depends on a hardware configuration we can't do on CI)
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

/cc @mollymerp @mourner @mzdraper

Fixes issue #7247: heights over 65,536 meters don't render on some devices.
See discussion in issue #2096.
@ChrisLoer
Copy link
Contributor Author

Running on Desktop Chrome:
screenshot 2018-09-18 13 02 56

Running on iPhone 8:
image from ios 2

@ryanhamley
Copy link
Contributor

ryanhamley commented Sep 18, 2018

Does this also close #7104 or is that a separate problem? It seems like it should. John tried to fix that with https://github.com/mapbox/mapbox-gl-js/compare/extrusion-mediump but it wasn't successful. It might have to be highp for this use case.

@ChrisLoer
Copy link
Contributor Author

Yeah looks like the same problem -- it's an extrusion layer set to 100,000 meters... and I just now see that John actually had a branch that did almost the same thing as what I did here, except he went to mediump instead of all the way to highp.

Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants