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

Feature RGBA-encoded elevation #1463

Open
3 tasks
gchoqueux opened this issue Sep 11, 2020 · 2 comments
Open
3 tasks

Feature RGBA-encoded elevation #1463

gchoqueux opened this issue Sep 11, 2020 · 2 comments
Assignees
Labels
feature 🍏 Adds a new feature
Milestone

Comments

@gchoqueux
Copy link
Contributor

itowns is supposed to support RGBA-encoded elevation with ElevationLayer.
There is a option ELEVATION_MODES.RGBA but it's not possible to active this mode.

In shader, there is a method decode32 to decode rgba to float.

  • add ElevationLayer option to active ELEVATION_MODES.RGBA;
  • add example with ELEVATION_MODES.RGBA mode (you also need a server that provides such data);
  • replace decode32 by unpackRGBAToDepth from Three.js;
@gchoqueux gchoqueux added the feature 🍏 Adds a new feature label Sep 11, 2020
@gchoqueux gchoqueux added this to the 2.xx.x milestone Sep 11, 2020
@LoicUTC LoicUTC moved this from Todo to In Progress in Next Version (September 2023) Jun 1, 2023
@LoicUTC LoicUTC added this to Roadmap Jun 19, 2023
@LoicUTC LoicUTC moved this to Mid term in Roadmap Jun 19, 2023
@jailln
Copy link
Contributor

jailln commented Jul 13, 2023

@AnthonyGlt can you fill this issue with your tests and first results and maybe share produced datasets?

@AnthonyGlt
Copy link
Contributor

For my tests, I've used TMSSource. I've removed from GlobeView.js the error threw when the elevation layer crs isn't in EPSG:4326 (for mapbox, it's in EPSG:3857).
I've had to set the option useRgbaTextureElevation of my elevation layer. I removed the triggered error in RasterTile.js.
Then I had to decode the RGB value to get the elevation.
To do that I've modified elevation_pars_vertex.glsl and implemented this formula https://blog.mapbox.com/global-elevation-data-6689f1d0ba65

I was able to load the elevation, however there is an issue with the camera culling. The tiles closest to the camera are not loaded. This seems to come from the missing zmin in the bounding box (Obb.js).
You can check my forked branch : https://github.com/AnthonyGlt/itowns/tree/terrain
Note: My html example is messy (still testing).

To generate the elevation data, I've used gdal to convert IGN data to a .tif, then, using rio-rgbify, I was able to obtain rgb encoded data. We can then convert the data to mbtiles using rio-rgbify or mb-util.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 Adds a new feature
Projects
Status: Mid term
Development

No branches or pull requests

3 participants