3DGI / tyler

Tiling 3D city models encoded in CityJSON
Apache License 2.0
29 stars 4 forks source link

Invalid position buffers #42

Open jpvanmuijen opened 1 year ago

jpvanmuijen commented 1 year ago

I am trying to use the Tyler generated tilesets in Cesium for Unity/Unreal/JS. The tiles are loading correctly (i.e. shown in the hierarchy), but no geometry is shown. Unreal returns the following error; LogCesium: Warning: [..]/tiles/1/1/1.glb mesh 0 primitive 0: Invalid position buffer. I've tried both implicit and explicit tiling, but to no avail. When loading the tilesets in our own Unity Kadaster viewer, all is working well.

TylerUnity
balazsdukai commented 1 year ago

@jpvanmuijen so if I understand well, then the problems is only with Cesium for Unreal?

Cesium for Unity does work. Correct?

What about CesiumJS?

jpvanmuijen commented 1 year ago

No, sorry. None of those three seem to work. Unity just doesn't throw any errors. JS returns An error occurred while rendering. Rendering has stopped. TypeError: Cannot read properties of undefined (reading 'featuresLength') I've also tried to test the 3d.test.kadaster tilesets (which you are probably familiar with), which return the same Invalid position buffer errors in Unreal (and thus also don't work in Unity & JS).

balazsdukai commented 1 year ago

Could you try to load https://data.3dgi.xyz/3dtiles-test-data/tilesets/buildings/tileset.json into Unreal?

And what is the software from the screenshot above?

jpvanmuijen commented 1 year ago

That URL also returns the Invalid position buffer error. The screenshot above is the Unity viewer (and parser) created by 3D Amsterdam. Just to be thorough, I also tried loading the above tileset in Cesium for Unity (second screenshot below). This also does load the tileset, but no geometry. Annoyingly though, no errors.

Screenshot 2023-07-24 170710 Screenshot 2023-07-24 171513
balazsdukai commented 1 year ago

Thanks for checking. You can view the tileset that I linked here: https://dev.3dgi.xyz/test-cesium-3dtiles , and the code for the viewer is here: https://github.com/3DGI/test-cesium-3dtiles/blob/main/src/index.js This viewer uses CesiumJS v1.104.0

I'm not familiar with the Cesium integrations for Unity or Unreal, so I cannot say what goes wrong. But I can think of two things:

Could this be the problem?

jpvanmuijen commented 1 year ago

Thanks! My JS setup was very quick & dirty, but good to know that this does seem to work. That might actually solve the business issue for me. I will go ahead and setup a proper JS application.

As for Unreal; this page refers to the two metadata extensions, where it states that they currently support _featuremetadata but are planning to move to _meshfeatures. Which implies that they don't support the latter yet, so that might be the main issue?

The Unity documentation doesn't even mention these extensions, so that might be a long(er) shot.

Edit: so even in the most basic setup, your tileset does indeed seem to work, but mine still doesn't. Could you maybe have a look at my attached tileset, to see what might be wrong with it? These tiles are located in the Rotterdam Erasmusbrug area, around 51.90944081036277, 4.485912853416279

230721.zip

jpvanmuijen commented 1 year ago

When I set up a barebone CesiumJS viewer and try to load the previously attached 230721 tileset, I still get the Error: Cannot read properties of undefined (reading 'featuresLength') I have another tileset which I've created with explicit tiling, which does seem to load ok. Still an error, but only once, and the geometry is shown. However, I noticed in your sample you are also using implicit tilesets which seem to load perfectly fine. So I guess something is wrong with my implicit tileset.

Anyway, the original issue for Unreal and Unity still stands, but if you prefer, we can close this issue for now.

Screenshot 2023-07-24 200820 Screenshot 2023-07-24 200835 Screenshot 2023-07-24 201347
balazsdukai commented 1 year ago

It would be good to get to the bottom of this.

Could you tell me these please?

jpvanmuijen commented 1 year ago

Ok, great! Thanks for the effort.

the tyler command

docker run -it -e RUST_LOG=debug -e PROJ_DATA=/usr/local/share/proj -v %cd%:/data --rm tylerdocker tyler ^
--metadata /data/metadata.city.json ^
--features /data/Noordereiland ^
--output /data/output ^
[..]

(I'm using a .bat file on Windows) tyler version (tyler --version) 0.3.5 (2023-06-28) your OS Win11 which exe are you using (docker, win exe, self complied) Docker sample of the input data Noordereiland.zip metadata.city.txt (renamed to .txt for the upload)

jpvanmuijen commented 1 year ago

Hi, any updates on this @balazsdukai ? I tried things the other way round, but it seems like the explicit tileset isn't loading properly in our own parser. That's probably something going wrong on our end, but I would very much like to focus on implicit tiling and getting that to work on CesiumJS anyway. So any pointers as to what might be wrong with my 230721 tileset would be very much appreciated. Thanks!