-
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
add raster-dem source type and hillshade layer type #5286
Conversation
f7eb44b
to
d000949
Compare
57840c2
to
3e6a146
Compare
@kkaefer making progress with testing + getting through the backlog. The raster masking did fix the overlapping tile flashes, but there is still flickering coming from the texture getting updated with more border data as neighboring tiles load. Tomorrow, I will be focusing on alternative solutions to that tile flickering and writing more unit tests, but whenever you have time to review the PR in its current state that would be much appreciated. Thanks! I may have questions about performance + profiling as well as I try to get this through the finish line. |
note that hillshade layer types aren't rendering and don't produce console errors on the 2 android devices that I've tested it on. will try and get my hands on a test device to debug more thoroughly ASAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried out this PR and I'm still seeing a few issues.
- In Safari and Firefox, rendering looks weird (Chrome looks fine):
- Tiles are clipped when they don't have a backfilled border, but it's still showing a 1px border for some tiles:
- There appears to be a drawing problem (possibly related with the double draw?) when overzooming tiles. These frames are select from a zoom in animation:
- When zooming in, we seem to be evicting parent terrain tiles before we can render the new ones. These are 6 consecutive frames after zooming in:
test/unit/data/dem_data.test.js
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: whitespace
1d28035
to
26d37a8
Compare
these were both issues w the debug page (not ensuring the file extension of the terrain source was
fix for this is up at #5380 (i've collapsed some of the rendering images already being addressed into will be working on the tile border issues and the disappearing child tiles tomorrow. |
26d37a8
to
3718abc
Compare
I can't reproduce the parent tile eviction on zoom in but I did find an issue where we were evicting child tiles prematurely on zoom out if the zoom out is > 1 zoom level. I think this is a bug in native as well. |
d5798f2
to
605a487
Compare
I tested out a new approach to tile borders that I think looks pretty good compared to the flashing white borders – when a tile first loads I create a 1px border around the original image populated with the elevation data from the nearest pixel with real data, and then I replace this value with the real neighboring tile data once it loads. I think it looks a lot better than the previous approach, and it solves the issue of flashing / persistent white seams. |
@nickidlugash when you have a sec to look at the shaders / default style-spec properties that would be great. you'll need to pull down this branch and then you can run To modify the intensity / zoom function you'll want to play around with this line, and then the final shading color is set here let me know if you have any questions! |
@kkaefer today I was able to isolate the missing tiles to an issue with the If you change the code so that When I render out the raw pixel data we're passing into the |
src/source/raster_dem_tile_source.js
Outdated
if (this.map._refreshExpiredTiles) tile.setExpiryData(img); | ||
|
||
if (img) { | ||
if (this.map._refreshExpiredTiles) tile.setExpiryData(img); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're already executing this code two lines above. Is this needed again?
src/source/raster_dem_tile_source.js
Outdated
if (!tile.workerID || tile.state === 'expired' || tile.state === 'unloaded') { | ||
tile.workerID = this.dispatcher.send('loadDEMTile', params, done.bind(this)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when there's no img
object? Can this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that ajax#getImage
prevents a case where there'd be no img
and no err
src/source/raster_dem_tile_source.js
Outdated
rawImageData: rawImageData | ||
}; | ||
|
||
if (!tile.workerID || tile.state === 'expired' || tile.state === 'unloaded') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we starting a new loadDEMTile
worker when the the tile is expired or unloaded/aborted?
2fb24da
to
6ebe2b2
Compare
💀 the missing/flickering tiles were due to I also was able to fix the rendering failure on android by setting precision to as I see it the outstanding items (copied from above) are
|
update tests for WebWorkerTransfer
63a0fb5
to
0bfea45
Compare
0bfea45
to
a3deabf
Compare
thanks for sticking with me y'all ⛰ 🗻 ⛰ note that there may be some caching on the api side that causes the endpoint to still return webp files so you may need to use the following transform function for the next few hours transformRequest: (url, resourceType) =>{
if (resourceType === 'Tile' && url.search('terrain')) {
return {
url: url.replace('@2x', '').replace(/(\.webp)|(\.png)/, '.pngraw')
};
}
} |
I have been following this PR for awhile. This is some really great work @mollymerp Nice job! 🎉 I look forward to trying this layer type out |
Moving to a fresh PR in place of #4701
This PR implements client-side hillshading using the Mapbox Terrain RGB tileset – right now it is not extensible to other DEM encoding formats.
Todo:
Texture
+ maybeRenderTexture
classes.pngraw
when requesting terrain-rgb tilescc @kkaefer
Launch Checklist