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

Enable immediate mode rendering for custom layer in globe view #12143

Closed
wants to merge 3 commits into from

Conversation

akoylasar
Copy link
Contributor

@akoylasar akoylasar commented Aug 8, 2022

This is a POC to enable immediate rendering for custom layer when globe view is enabled. We can use this PR as a discussion panel to decide what needs to be exposed and in what way.
Previously a POC for draped rendering of custom layers was introduced in #11996.

globe-custom-layer.mov

cc @astojilj

Launch Checklist

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/map-design-team @mapbox/static-apis if this PR includes style spec API or visual changes
  • tagged @mapbox/gl-native if this PR includes shader changes or needs a native port
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog></changelog>

@mpulkki-mapbox
Copy link
Contributor

mpulkki-mapbox commented Aug 10, 2022

We have solved this internally in gl-native by providing a helper function that automatically converts any (well defined) model matrix into a one suitable to be used with the globe. In practice this is done by pre-multiplying the given model matrix with a coordinate frame matrix (scale & orientation) that describes tangent plane at the given location on the surface of the globe. Additionally some minor modifications are done for representing translation part of the matrix.

This has some benefits as we don't need to expose any implementation details to the application. This also means that users don't need to do anything to support the transition between globe and mercator.

@mpulkki-mapbox
Copy link
Contributor

We have solved this internally in gl-native by providing a helper function that automatically converts any (well defined) model matrix into a one suitable to be used with the globe. In practice this is done by pre-multiplying the given model matrix with a coordinate frame matrix (scale & orientation) that describes tangent plane at the given location on the surface of the globe. Additionally some minor modifications are done for representing translation part of the matrix.

This has some benefits as we don't need to expose any implementation details to the application. This also means that users don't need to do anything to support the transition between globe and mercator.

...although we might want to expose more advanced controls/tools to users as in your POC. Some visualizations such as trajectories might be easier to render directly in pixel coordinates unless the data is defined in mercator projection.

@akoylasar
Copy link
Contributor Author

I think it all depends what we want to do but I am also preparing a different demo and refactor what I have already exposed.

@beifeizhou
Copy link

beifeizhou commented Dec 2, 2022

Hi team,

This feature looks very useful. Do you think it is possible to load a 3D model (for instance iss satellite model), by setting up the coordinates and the altitude?

Currently I am only able to use mapbox to add 3d model on a flat map, but not in the globe view.

@akoylasar
Copy link
Contributor Author

closing this one since it's already implemented via #12182

@akoylasar akoylasar closed this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants