-
Notifications
You must be signed in to change notification settings - Fork 348
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
Quantized-mesh output support #64
base: master
Are you sure you want to change the base?
Conversation
Provides two new features: - New quantized-mesh format ouput - New metadata file output
It simplifies the code to write new output formats (MBTiles...). It defines a set of abstract classes that anyone could override to implement its own logic when serializing.
9a21915
to
1f5c1fb
Compare
I've just built this branch and generated quantized mesh tiles for some elevation data I've been working with and can confirm all seems to work well. Would be good to get it merged in Thanks to @ahuarte47 for a quick fix and @markerikson for help in getting it built |
i successfully build a terrain as Meshformat with Normals plus Cesiumfriendly option. Its working great @ahuarte47 , to use the normal information in cesium i had to set the maybe that could be done by ctb-tile when the layer.json is generated by setting the |
Thanks @LHolst for the feedback! I will add the "extensions" entry. |
The extensions entry works. Thanks @ahuarte47 When using the cesiumFriendly option, the missing toplevel Lastly, it would be nice when using 'Normal' and 'CesiumFriendly' together, the normals of the copied missing see wrong normals on the left, i modified the layer.json by setting |
Thanks @LHolst for your feedback and advices! About flipping normals in that copied missing root tile, it needs some more of work |
i really appreciate your help, root tiles working now 👍 |
Hi @LHolst, finally I have changed how CTB creates the missing root tile, now it is created from a temporary empty elevation that spatially overlaps the missing tile. I hope it works |
I am getting an bounds error Exception when using
without the layers option tiles get generated |
d8b8433
to
d0bafbb
Compare
Hi @LHolst, I fixed a bug, I hope it works now |
d0bafbb
to
4bb78ba
Compare
ahuarte47@4bb78ba generates layer.json correctly, thanks @ahuarte47 👍 🎉 also #15 (comment) did the trick to run gdal 2.2 |
for anyone who wants to test this PR using docker:
works great for us. many thanks |
Generate terrain from dem.tif EPSG:4326
But when set |
@winsento you need to run the command without |
Today I created an Alpine Linux based Docker image: tum-gis/cesium-terrain-builder-docker#5
Get it here: This has not been properly tested jet. I'm happy for any feedback. |
Support GDAL 3.0 in cesium-terrain-builder
Support GDAL > 3.0 (Traditional GIS-friendly axis order)
Support for both versions
I have used your Quantized-mesh builder to created tiles of the world tiff file. But the world tiff file contains bathymetery data and on viewing the tiles on Cesium using new Cesium.CesiumTerrainProvider , the land is below the oceans, like in a trench. ( the land 3d works well ) I asked in cesium forum and they mentioned that nothing can be done from the cesium end and it has to be changed at how the data is generated. I saw in your limitations and To-Do that you consider all tiles as land. Is that why the ocean is above? How is the positive altitude coming from? |
are you still working on this? index 9bab8ff..390cca9 100644
--- a/src/HeightFieldChunker.hpp
+++ b/src/HeightFieldChunker.hpp
@@ -1,6 +1,8 @@
#ifndef HEIGHTFIELDCHUNKER_HPP
#define HEIGHTFIELDCHUNKER_HPP
+#include <cassert>
+
/*******************************************************************************
* Copyright 2018 GeoData <[email protected]>
*
@@ -226,6 +228,7 @@ public:
/// Return the array-index of specified coordinate, row order by default.
virtual int indexOfGridCoordinate(int x, int y) const {
+ assert((y * m_size) + x < m_size * m_size);
return (y * m_size) + x;
}
/// Return the height of specified coordinate. m_size is 256, y is 256, but the array the code is reading and writing is only 256x256. so clearly, the addresses are out of bounds. edit: I was able to fix it. the branch in my profile appears to work for me. In addition, it contains some code modernisation, and I ran it through address sanitizer. i'm still having trouble with rendering as tiles disappear when using a perspective camera (but not when using an orthographic one). i'm looking into it.. edit2: fixed the disappearing tiles. the quantised mesh branch was definitely broken here, but probably previous versions of cesium didn't care. fixed in my branch as well. still needs a bit of cleaning though.. |
fix some errors I found in use
@ahuarte47 @ShawayL I just reflected your changes in the https://github.com/tum-gis/cesium-terrain-builder-docker Docker image. |
wow! great!!!!!!!!!!! |
I believe that the problems with normals at the perimeter of tiles are intrinsic to how the tiles are built. The normal for each vertex is computed as a weighted average of the normals of all the triangles containing such vertex. That can be computed for all vertices in the tile except for those vertices in the perimeter, as you can only access some of the triangles that contain them. One solution would involve generating the tiles without the per-vertex normal extension, and then on a second stage (when the vertices for all tiles have been computed), compute and append the normals for each tile. Does this sound right, @ahuarte47? |
Maybe the issue is related with what neighbour vertices are used to calculate the normals. I think that row of wrong normals can be located in 0 longitude. Normals of triangles located in the left and in the right side of that X/lon were calculated with a different subset of vertices. It would need work to validate this theory and a fix to resolve the issue. Unfortunatelly I can not maintain this effort, any help is welcome. |
Is this issue what is preventing this MR to be merged? |
the fix by #64 (comment) is really important - without it --profile mercator crashes with the same symptoms described above same goes for https://github.com/tum-gis/cesium-terrain-builder-docker is this project still maintained? |
Hi @mhaberler I am so sorry, I am not maintaining this branch, maybe other fork is beeing improved. |
Hey @mhaberler, |
why do generated layer json has bounds |
Provides some new features:
Details:
https://www.linkedin.com/pulse/fast-cesium-terrain-rendering-new-quantized-mesh-output-alvaro-huarte/
Update 2018/08/08:
Available Cesium Terrain Builder Docker thanks to @BWibo