-
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 #55
Conversation
10db395
to
825cbbc
Compare
a9ef4b8
to
2faff84
Compare
b1603fd
to
7e71d01
Compare
Seems very good so far during my tests, well done. Performance of Cesium took a leap forward compared to heightmap terrain tiles. There is one problem, when I tried to play with --mesh-qfactor option, ctb-tile segfaulted. |
Thanks @kvuorine. About --mesh-qfactor error, may I have your settings or data to try fix it? |
With commands below you can get some of the data I am working with, I tested that this dataset produces wget http://kartat.kapsi.fi/files/korkeusmalli/hila_2m/etrs-tm35fin-n2000/L4/L41/L4141E.tif http://kartat.kapsi.fi/files/korkeusmalli/hila_2m/etrs-tm35fin-n2000/L4/L41/L4141G.tif http://kartat.kapsi.fi/files/korkeusmalli/hila_2m/etrs-tm35fin-n2000/L4/L41/L4141F.tif http://kartat.kapsi.fi/files/korkeusmalli/hila_2m/etrs-tm35fin-n2000/L4/L41/L4141H.tif
gdalbuildvrt merged.vrt L4141?.tif
mkdir terrain
ctb-tile -o terrain -f Mesh -g 1.1 merged.vrt |
ok, I'll review this as soon as possible |
6ce40a6
to
2e62d7e
Compare
Hi @kvuorine, I have fixed this option. Thanks for your notice! |
Hello @ahuarte47 ! I tried to use this code to generate quantized mesh for Cesium and it works very well. I had only an issue when i tried to generate tiles from two different adjacent tiff images (from SRTM dataset) : on the seam between these tiles there is a "canyon", a crack. I am sure that the tiffs data are correct, they are perfectly adjacent. I launched "ctb-tile" 2 times, each with a tile and on the seam this is the result... do you have some advice? should be the two tiles concatenated before launch ctb-tile? The result... |
Hi, I think you need an unique MDT that covers all area in order to execute the ctb-tile only once. You could create a virtual raster with "gdalbuildvrt" to virtually create an unique source from many individual files. You can see a previous comment to how to use or read about "gdalbuildvrt" tool:
|
Ok thank you very much, i will try this command! (Probably this is the solution, but i am asking the need of memory for the entire world tileset!) Looking at the image is interesting to note that the first generated tileset on the right is "cutted", the second on the left is "seamed" to globe. Futhermore looking far where the tiles are loaded with minor zoom level the canyon appers to be larger. These can be clues to uderstand. About the generation of the "layout.json" file, also this works very well, but again in my case with two tiles generated it is not very usefull. Could be interesting a tool that analize the directory tree and from this generate the layout.json. All this things let me understand that my approach is not correct. :) |
Ok, as not said. :) "gdalbuildvrt" solves perfectly the problems, also the "layer.json" one. Thank you a lot! :) |
Is there a technical reason as to why the new "-l" option is separate from the actual terrain generation? For large datasets, generating the layer.json file still takes quite a while. |
Hi @ediebold, there is none technical reason. But I thought it seems better two separate tasks, I can be wrong but it looks more versatile. You could create the layer.json of existing old terrain sets, or update only a specific level without overwriting an existing json file (You could have edited it with your own settings). If you update a level, only the limits of it are calculated. |
How about creating layer.json if there is none when generating tiles, but update layer.json only with command line option selected? I have been testing --mesh-qfactor option which now doesn't crash the program, but I don't quite get the purpose of this option because tileset size on disk doesn't seem to vary at all when testing different values. @ahuarte47 could you explain it a bit? |
Thanks everybody for your advices, I will try to integrate the -l option as complementary to -f option, but it will require me to do many changes in the original base code, but indeed it seems more logic. About --mesh-qfactor option, it is supposed larger values should mean minor amount of triangles with minor quality. As my little tutorial said, the process takes care of an input geometric error to safely merge each pair of triangles with its parent one if there is not a visible loss of quality. The factor multiplies the default error value, larger values should mean minor quality. Did not you notice any change? You can set "wireframe" rendering mode in Cesium to compare between different factors |
Hi @kvuorine, I changed the code, now CTB creates the layer.json if there is none when generating tiles. Thanks everybody! |
@ahuarte47 Thanks for your support. I did notice difference in terrain. I just thought simplified mesh would take less space on disk and be quicker to serve over net. I guess simple mesh still reduces rendering workload. I tried to read your docs/tutorials earlier but that registration barrier was just too much for me. |
How to serve the generated tiles? @ahuarte47 I guess storing them on a simple apache directory is not an option, right? I tried to copy some tiles here temp-tiles (they are using the same files used by @kvuorine )
|
Set as URL the root directory: without the json file. |
@epifanio , I also have following apache directives for the directory
Not sure if quantized-mesh requires them, but I had problems serving heightmap tiles without those. |
Hi, I'm still having troubles with the missing tiles issue.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Hello World!</title>
<script src="../Build/Cesium/Cesium.js"></script>
<style>
@import url(../Build/Cesium/Widgets/widgets.css);
html, body, #cesiumContainer {
width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
Cesium.BingMapsApi.defaultKey = '------------------------'
var viewer = new Cesium.Viewer('cesiumContainer');
var terrainProvider = new Cesium.CesiumTerrainProvider({
url: 'tiles/'
});
viewer.terrainProvider = terrainProvider;
viewer.scene.globe.enableLighting = true;
</script>
</body>
</html>
On OSX, using safari as the browser, I got the following in the JS console:
Can you help me to understand what I'm missing/doing wrong? |
bdb93ef
to
6e21917
Compare
Hi @ahuarte47, I got a error in my building. Please help me! |
Hi @CosmosEcho, I succesfully built with VS2017, but I did a change |
@ahuarte47 Which gdal version did you used? |
I use : GDAL 2.3.0dev, released 2017/99/99 |
I can not build. The problem is not solved. I think that I need change my env as yours, but I could not found GDAL 2.3.0dev https://trac.osgeo.org/gdal/wiki/DownloadSource |
Is the problem here? |
It is weird, the signature of this function has not changed for a long time, it is equal in 2.0...2.2 Edit: |
18c7267
to
e8d234d
Compare
This defines a set of abstract classes that anyone can override in order to implement new formats when serializing the terrain tiles.
e8d234d
to
5869f75
Compare
@ahuarte47 OK, thank you!I will try it again. |
Is that true? "GDALCreateOverviewDataset missing since gdal-2.2" |
Hi @ahuarte47, I still can't build completely. Can you give me a builded exe? I want to test my data. |
I did some experimenting on Friday with re-implementing the MBTiles changes on top of the latest version of this branch, and generated some test terrain that included the vertex normals data. At first I didn't see any difference visually between quantized-mesh + vertex normals, and quantized-mesh without normals. I finally figured out that it only matters when you've got For our use case we don't care about time of day lighting, so I'm going to skip trying to regenerate that terrain set using vertex normals. I will try to finish re-implementing the MBTiles and missing tiles logic on top of this branch, but it'll have to wait until I have time to finish it outside of work, which may be a while. |
Hi @CosmosEcho; where could I copy you a zip file (31mb) with CTB+GDAL for Windows x64? |
@ahuarte47 It's very nice about a zip file. You can send it to my email: [email protected]. Many thanks! |
@ahuarte47 if my data problem. |
Hello,
Any clues? |
Hello @bjpirt, I have pushed a minor change. Could you test it? thanks! |
Ups! sorry I did a mesh with git, I accidentally closed this pull, I reopend it as #64 |
I keep getting this error:
and
I've added the files to /0/0/0.terrain and /0/1/0.terrain and I have generated layer.json and tried to add existing layer.json too. I can access the files via http http://localhost/data/tilesets/terrain/test/ And I have same location in CesiumTerrainProvider:
Where is this web.config you want to edit? I've tried multiple types of tif images and even converting xyz-files but all they get stuck at that same point where I try to show them in Cesium.js. I'm using docker versions of ctb and terrain-server, are they up to date? |
@Crare I can confirm that the tumgis/ctb-quantized-mesh Docker image is up-to-date. If you want to make sure you are using the latest commit, you can simply build the image yourself.
|
Provides some new features:
Details:
https://www.linkedin.com/pulse/fast-cesium-terrain-rendering-new-quantized-mesh-output-alvaro-huarte/