Forum

Author Topic: We really need help to fix the Cesium tiled format output  (Read 2960 times)

cyrilp

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
We really need help to fix the Cesium tiled format output
« on: January 20, 2022, 06:25:25 PM »
There is definitively something wrong with the cesium tiled output.

There have been several messages on the forum about that so i'm not the only one having issues.

Could please have a look, this i a very important feature to be able to use our very large models.  :-\

Here is a tiled model generated by metashape:

Using cesiumjs with inspector tools:
https://www.gigascope.net/vr/tilesfrommetashape/

Using my aframe vr viewer:
https://www.gigascope.net/vr/tilesfrommetashapeaframe/

link to download the tiles:
(https://data2.gigascope.net/3d/tilesfrommetashape/street0.zip)

And the tiled model from cesium when i upload the obj to cesium:

Using cesiumjs with inspector tools:
https://www.gigascope.net/vr/tilesfromcesium/

Using my aframe vr viewer:
https://www.gigascope.net/vr/tilesfromcesiumaframe/

As you can see something is broken in the metashape output, you can use the inspector to see that the Bounding and Content volumes are wrong.  :o :o

some of the previous topics about that issue:
https://www.agisoft.com/forum/index.php?topic=12730.msg61211#msg61211
https://www.agisoft.com/forum/index.php?topic=13121.msg58197#msg58197
https://www.agisoft.com/forum/index.php?topic=11978.msg53691#msg53691



Dmitry Semyonov

  • Agisoft Technical Support
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: We really need help to fix the Cesium tiled format output
« Reply #1 on: January 21, 2022, 03:50:21 PM »
Hello Cyrilp,

Thank you for the links.

I noticed that you are using default maximum screen space error = 16 in CesiumJS viewer for Metashape exports. Please note that Cesium 3D Tiles export in Metashape 1.7 and earlier versions was optimized for maximumScreenSpaceError=1, so you need to use maximum screen space error = 1 instead in CesiumJS viewer to see detailed LOD levels. Starting from Metashape 1.8 Cesium tiles exporter is optimized for maximumScreenSpaceError=16, so no manual adjustment in CesiumJS will be necessary after update.

After I changed maximum screen space error to 1 in 3D Tiles Inspector window for https://www.gigascope.net/vr/tilesfrommetashape/, I got the same visualization as in https://www.gigascope.net/vr/tilesfromcesium/.

Quote
As you can see something is broken in the metashape output, you can use the inspector to see that the Bounding and Content volumes are wrong.

Metashape uses regular octree subdivision scheme for Bounding volumes for more consistent LOD level switching, which is different from the irregular subdivisision scheme used in https://www.gigascope.net/vr/tilesfromcesium/ example. But to the best of my knowledge it is perfectly supported by the specification:

Quote
The content.boundingVolume property defines an optional bounding volume similar to the top-level boundingVolume property. But unlike the top-level boundingVolume property, content.boundingVolume is a tightly fit bounding volume enclosing just the tile’s content. boundingVolume provides spatial coherence and content.boundingVolume enables tight view frustum culling, excluding from rendering any content not in the volume of what is potentially in view. When it is not defined, the tile’s bounding volume is still used for culling (see Grids).
http://docs.opengeospatial.org/cs/18-053r2/18-053r2.html#31

What exactly seems wrong to you in bounding/content volumes saved by Metashape?

With best regards,
Dmitry Semyonov
Agisoft
With best regards,
Dmitry Semyonov
Agisoft

cyrilp

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: We really need help to fix the Cesium tiled format output
« Reply #2 on: January 21, 2022, 06:17:02 PM »
Great it's now working fine using cesium js !

but it's still doesn't work in aframe, any idea why ?

is 1.8beta exporter already optimized for maximumSSE = 16 ?

Dmitry Semyonov

  • Agisoft Technical Support
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: We really need help to fix the Cesium tiled format output
« Reply #3 on: January 23, 2022, 05:40:58 PM »
Hello Cyrilp,

Quote
but it's still doesn't work in aframe, any idea why ?

It looks like aframe doesn't recognize and apply RTC_CENTER property from the Batched 3D Model Feature Table:
http://docs.opengeospatial.org/cs/18-053r2/18-053r2.html#141

This property specifies offset that needs to be added to all vertex coordinates, and without this offset vertex coordinates are shifted away from their corresponding bounding volumes.

Quote
is 1.8beta exporter already optimized for maximumSSE = 16 ?

Cesium 3D Tiles are optimized for maximumScreenSpaceError=16 starting from Metashape 1.8.0 build 13111.
With best regards,
Dmitry Semyonov
Agisoft

Dmitry Semyonov

  • Agisoft Technical Support
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: We really need help to fix the Cesium tiled format output
« Reply #4 on: January 31, 2022, 11:16:10 AM »
Hello Cyrilp,

We updated Cesium 3D tiles export to use root tile transform instead of RTC_CENTER property in Metashape 1.8.1 build 13915.

Cesium 3D tiles exported from this new version should be compatible with both CesiumJS and aframe viewers.

Please let us know if there are still any problems.
With best regards,
Dmitry Semyonov
Agisoft

cyrilp

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: We really need help to fix the Cesium tiled format output
« Reply #5 on: February 03, 2022, 12:38:38 AM »
Hi,

thanks a lot for that modification.

is the modification in the tile generation or export part ?

If i have a tiled model from a previous version, can i export it with this new version and it will work ? or do i have to generate the tiles again with the new version ?

Dmitry Semyonov

  • Agisoft Technical Support
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: We really need help to fix the Cesium tiled format output
« Reply #6 on: February 05, 2022, 03:45:24 PM »
Hello Cyrilp,

The change was only in the export function, so there is no need to regenerate the tiles.

Moreover, you can even convert already exported tiles using Agisoft Viewer utility using the following procedure:
- Open existing tileset in Agisoft Viewer using Add Layer... command from File menu
- Select Save Layer... command from the layer context menu in the Layers pane
- Select Cesium 3D Tiles format in the Save As dialog box and provide a filename for the converted tileset.
With best regards,
Dmitry Semyonov
Agisoft