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

Add option to render metal view continuously #514

Open
Cal-um opened this issue Jul 1, 2021 · 4 comments
Open

Add option to render metal view continuously #514

Cal-um opened this issue Jul 1, 2021 · 4 comments
Labels
feature 🍏 When working on a new feature or feature enhancement

Comments

@Cal-um
Copy link

Cal-um commented Jul 1, 2021

New Feature

Add option to render metal view continuously in the MapView class. The MTLView needs to be configured with
metalView.isPaused = false metalView.enableSetNeedsDisplay = false
as per the docs https://developer.apple.com/documentation/metalkit/mtkview

Timed updates: The view redraws its contents based on an internal timer. In this case, which is the default behavior, both isPaused and enableSetNeedsDisplay are set to false. Use this mode for games and other animated content that’s regularly updated.
Currently these are set to true.

Why

For metal SceneKit integration this is required to let the nodes animate. I need this is my current use case.

@vincentborcard
Copy link

I modified metalView.isPaused = false metalView.enableSetNeedsDisplay = false in MapView.swift and it allows to continuously render metal view. Thx Cal-um. I also would like to change that through an option.

In my case, to continuously update the position of a 3D node on a path retrieved from a lineString (turf). I modified the SceneKitExample.swift to do that.

But modifying metalView.isPaused = false metalView.enableSetNeedsDisplay = false produce some strange elevation with the Hillshade. Any idea why it happens?

Screenshot 2021-08-22 at 19 20 07

@macdrevx macdrevx added the feature 🍏 When working on a new feature or feature enhancement label Dec 23, 2021
@macdrevx
Copy link
Contributor

#964 exposed a new API that allows client code to request that the map redraw. You may be able to use that to solve some of the same problems that would be addressed by continual metal view rendering.

@Cal-um
Copy link
Author

Cal-um commented Jan 27, 2022

@macdrevx Is this API intended to be used for animations? Would it be used called continuously with a display link when needing to animate a node?

@macdrevx
Copy link
Contributor

Yes, you'd need to invoke it any time something happens in your model that requires a new drawing pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 When working on a new feature or feature enhancement
Projects
None yet
Development

No branches or pull requests

3 participants