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

Expression support #251

Open
maxammann opened this issue Feb 4, 2023 · 0 comments
Open

Expression support #251

maxammann opened this issue Feb 4, 2023 · 0 comments
Labels
feature-request Request for a new feature

Comments

@maxammann
Copy link
Collaborator

maxammann commented Feb 4, 2023

🤔 Expected Behavior

We want some kind of expression support. Though we first need to find out how expressions are used and whether we can find a simpler model.

@kimpham54 is working on getting some numbers.

😯 Current Behavior

Expressions are not supported.

💁 Possible Solution

How does it work in maplibre?

Expressions are always evaluated on the CPU. With evaluation I mean a function of fn evaluate(expression: JSON) -> number | fn interpolate(min: number, max: number: zoom: number) -> number.

The trick maplibre uses to make expression dependent on the zoom is that they evaluate the returned function on the GPU. That function is only interpolating linearly between two values though.

maplibre does not translate expressions to shader code in any way.

🔦 Context

Here maplibre-gl-js sends the current zoom to the GPU: https://github.com/maplibre/maplibre-gl-js/blob/9d107a5f5651b6adfa49a87419dc7648a57249da/src/data/program_configuration.ts#L313

💻 Examples

None

@maxammann maxammann added the feature-request Request for a new feature label Feb 4, 2023
@maxammann maxammann changed the title Expression support. Expression support Feb 5, 2023
@maxammann maxammann added this to the Far far future milestone Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant