-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support custom layer types powered by WebGL #281
Comments
No current plans to do this. |
I know this is closed but I'd love to see it for things like controlling saturation or other levels on a raster layer. |
This is worth leaving open, now that we "support" this in gl-native |
@enjalot can't you control saturation and other stuff with raster paint properties? |
@mourner oops I didn't see the other levels besides opacity before. I still believe that this could lead to very interesting customizations! depth of field, blurs, animations and a lot of other shiny stuff 💯 |
EDIT: A newer specification is discussed in #281 (comment) below 👇 Here's our plan for implementing this feature:
|
Based on the experience we've had with custom layer types on GL Native and custom sources in GL JS, I'm proposing a new specification:
interface StyleLayer {
getRendererAtoms(
camera: Camera,
callback: (error: Error, atoms: Array<RendererAtom>) => void
);
}
|
I'm on board with that plan if the overhead isn't too big. |
Given that we do 500-1000 draw calls per frame with vast state changes between them, 2 more shouldn't make much difference. We could also introduce a "red button" option to forego state resets completely (with "use at your own risk" label). For resetting state, there's an existing module we might find useful: https://github.com/stackgl/gl-reset |
For reference, Mapzen supports something similar to what @mourner is suggesting ("augment existing shaders" that draw each layer) allows creation of maps like this: https://mapzen.com/blog/behind-the-scenes-tron2/ Here's how they're integrated: https://mapzen.com/documentation/tangram/Shaders-Overview/ and some of their modular shader "blocks": http://tangrams.github.io/blocks/ This could be a very performant way of natively supporting some cool animated visualizations that right now are being built external to the core (such as with Uber's Deck.gl). |
This was inadvertently closed due to some 🌳 history magic (the commit message that closed this intended to close style-spec's issue of the same number) — reopening. |
Hey there, are there any new plans/timelines for this feature? |
@mourner applying shaders to map layers (as in your demo) — is very, very powerful and awesome thing and very expected from a webgl-map. Did something move in this direction? |
The hack proposed by @mourner no longer work since 0.39 I used that a lot. If someone can fix the hack, it would be very appreciated, since it worked very well and was easy to implement! Until we get an official way to do this. |
Hey, I'll try to update the hack to work with recent releases. However should really look into exposing a proper API for this. |
Thanks a lot! I hope there will be an API for that too! |
Opened a new issue with a summary of our current thinking about this API: #6456 — closing this issue in favor of the new one. Let's discuss there. |
@ansis and I have discussed the possibility of allowing people to write custom glsl shaders. While the learning curve is fairly steep, the possibilities are pretty mindblowing when considering integrated data vis and animated, interactive basemaps.
Checkout these shaders for inspiration:
https://www.shadertoy.com/view/MsXGRf
https://www.shadertoy.com/view/Msl3Rr
https://www.shadertoy.com/view/XdsGDB
http://glsl.heroku.com/e#13858.13
http://glsl.heroku.com/e#13880.2
I'm not really sure exactly how we would accomplish this, but hoping for discussion here.
cc @mourner @kkaefer @yhahn
The text was updated successfully, but these errors were encountered: