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 new custom shader parameter to style #4327

Closed
ibesora opened this issue Feb 24, 2017 · 2 comments
Closed

Add new custom shader parameter to style #4327

ibesora opened this issue Feb 24, 2017 · 2 comments

Comments

@ibesora
Copy link

ibesora commented Feb 24, 2017

Motivation

The current approach to shaders doesn't allow the user to create maps with custom-encoded data loaded via raster or vector tiles.
Take for example a map where the raster data is normal-mapped or something like this where the tiles loaded encode temperature or precipitation.

Design Alternatives

Do nothing and solve this case forcing the users to load ready-to-show raster or vector data, removing the extra-processing from the client and into the server, but losing the possibility of animatinc such data.

Design

Something like the GLTF technique's definition added to the style definition and new attributes to define shaders and which techniques are used would work.

Mock-Up

style = { "sources": { "normals": { "type": "raster", ... "technique": "normalMapping" } }, ... "techniques": { "normalMapping": { "program": "program0", ... } }, "programs": { "program0": { "fragmentShader": "duck0FS", "vertexShader": "duck0VS" }, ... } };

Implementation

The style parser should be modified to process the new tags and create the new techniques.
There should be a way to send uniforms to the shader per layer from the API so they can be changed on each repaint.
An error popup should be shown when the shader is not supported by the hardware it's tried to be run on.

@jfirebaugh
Copy link
Contributor

Thanks for the suggestions. We're tracking a very similar feature request in #281; let's keep discussion centralized there.

@andrewharvey
Copy link
Collaborator

or something like this where the tiles loaded encode temperature or precipitation.

and for simple colour mapping where you don't need a custom shader, it should be addressed by #3889

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

No branches or pull requests

3 participants