CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.02k stars 3.51k forks source link

Lines in I3DM cannot be displayed properly #10305

Closed SunnyBily closed 2 years ago

SunnyBily commented 2 years ago

Hello!

I am trying to display the lines of models in cesium, so I wrote the lines to glTF and added mode=1 to the Primitive of meshes, like this: 企业微信截图_16503398062735

Lines in B3DM can be displayed correctly. But when written in I3DM, lines are displayed as faces instead of lines. This is the result of cesium ion: 企业微信截图_16503358929294

This is the result of glTF viewer, with the same glTF data. 企业微信截图_1650335960939

It seems that the data type is not recognized when parsing i3DM.

Is this a bug? Or is it not allowed to write line data in 3dTiles I3DM?

Looking forward to your reply! Best Regards!

j9liu commented 2 years ago

Hi @SunnyBily, how are you loading in this model? Is it possible to provide a sandcastle that demonstrates this problem?

lilleyse commented 2 years ago

I wonder if this is fixed in the experimental i3dm loader. @SunnyBily could you try the enableModelExperimental option?

const tileset = new Cesium.Cesium3DTileset({
  url: "tileset.json",
  enableModelExperimental: true
});
SunnyBily commented 2 years ago

Thank you @lilleyse and @j9liu , but the lines in i3dm are still not being loaded correctly by experimental option. Here is a sandcastle that I mentioned in the problem description. I3DMLines.zip

lilleyse commented 2 years ago

@SunnyBily it's possible you're using an older version of CesiumJS that doesn't support the option. It seems to be working for me on main.

image

lilleyse commented 2 years ago

One other thing to note is that the experimental option isn't available in ion, but once the experimental loader is ready you'll see the i3dm loaded correctly in ion. This will happen around July. See https://github.com/CesiumGS/cesium/issues/9520 for the roadmap issue.

SunnyBily commented 2 years ago

@lilleyse Hi, I updated the latest version of CesiumJS, but I still can't get the expected result. I notice that you used tileSet0, but the root tileSet of the sample model is manifest.json. When I use manifest.json as the root tileSet with experimental option, nothing is displayed. 企业微信截图_16505030154602

But when I use tileSet0 as root tileSet, as you do, I finally get what I expect. 企业微信截图_1650502875755

Then I tried another model, an i3dm with both meshes and lines. The glTF of this model looks like: image image

This time I just used one tileSet to organize tile. But it still shows nothing. image

After I removed the lines in i3dm, everything was fine again. 企业微信截图_16505130378098

All of the above results were rendered with the experimental option.

Here are the files I just mentioned. TreeWithLines.zip TreeWithoutLines.zip

I wonder why I can't use the actual root tileset, manifest.json, for the first file. And, why does the problem still appear for later model even though I only use one tileset file?

SunnyBily commented 2 years ago

May I ask is there any new progress on this issue? @lilleyse

lilleyse commented 2 years ago

@SunnyBily It looks like the batch table is invalid. I see the property edgeLineIndex but it's neither a valid batch table JSON property or batch table binary property. See BatchTable for details on the batch table format.

Screen Shot 2022-05-09 at 3 59 07 PM

The error in the console is:

A 3D tile failed to load: http://localhost:8002/static/Downloads/TreeWithLines/3dTiles/6.i3dm.gz?v=1.1
Error: Failed to load model: http://localhost:8002/static/Downloads/TreeWithLines/3dTiles/6.i3dm.gz?v=1.1
Failed to load I3DM
Property edgeLineIndex requires a batch table binary.