-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support polygon blurring #192
Conversation
#140 is a prerequisite for this. |
I have added this to the WWDC milestone. Let's get all the relevant Outdoors-labeled issues there for easier tracking if the goal of #171 getting Outdoors working is part of the WWDC launch. |
Cross-referencing mapbox/mapbox-gl-js#236 |
There are still a lot of things that need to be done; I created separate tickets for these:
|
Do we need the blur properties to be transitionable? |
@incanus not necessary for transitioning between WWDC styles, but nice to have otherwise. |
Ok. #252 (non-WWDC). |
@gundersen blur side-by-side for context (click for full): |
wow. This is so close. @nickidlugash @edenh - thoughts on matching the darkness of the hill shades? |
The issue currently is that blurring is applied uniformly at all zoom levels. Supporting zoom-aware functions for blurring (#253) should get this near perfect. |
I'll take a crack at that shortly then @edenh. |
@edenh The blurring is already somewhat zoom-aware: It appears more blurred the further you zoom in, and appears less blurred the more you zoom in. As explained in #253 (comment), this isn't an easy thing to fix for now (we can revisit this later on). It looks like this is only a slight visual deviation from Mapnik's look, but please reopen a ticket if it's not and this is more urgent. |
@kkaefer here are a few comparisons. The blur is currently too aggressive and actually ends up degrading the quality a bit. If we can't hit functions, could we at least set a min zoom for the blur property (~14-15)? Original For these low zoom levels, I prefer the crispness without blur. Another example: |
For reference, the carto outdoor style starts hillshade polygon blurring at z14: at z14 --> |
The way blurring works is by rendering everything to a texture, then blurring the texture, then upscaling the texture to fit the tile. Currently, the texture is 256x256 pixels, which when upscaled looks very blurry. You have these options to control the blurring:
With a Previously: |
Ok. Setting the buffer size to 1024 generally helps if we cannot contain the blur to specific zoom levels, but I think 512 after z14 would be much better. |
@edenh What we can do is have function properties that are fixed to integer zoom levels, e.g. they wouldn't smoothly interpolate between zoom levels as you zoom in and out, but we could use stops to define values for integer zoom levels. Does that sound useful? |
Yes, that would be fine. We would probably want to minimize the amount of 'jumps' in blur to one or two at ~ z14 and 17 in that case. Would this just look like a stops function on the prerender-size property? |
I think this could work, since the complexity of hillshade polygons and density of contour lines change at integer zoom levels anyway. |
@kkaefer any chance you can hit stops for polygon blurring today? |
@edenh I will implement this tomorrow (Sun) morning. |
@kkaefer great. It will also be useful for some of the overlay work. |
Curious if any techniques from http://www.sunsetlakesoftware.com/2013/10/21/optimizing-gaussian-blurs-mobile-gpu would be applicable here to increase performance? |
We're already doing that:
|
For outdoors hillshades. Ideally this is a
blur
property that takes a pixel value.