Skip to content
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

Unstable 3d tiles rendering in itowns #1859

Closed
alexLuky opened this issue May 11, 2022 · 25 comments · Fixed by #2143
Closed

Unstable 3d tiles rendering in itowns #1859

alexLuky opened this issue May 11, 2022 · 25 comments · Fixed by #2143
Assignees
Milestone

Comments

@alexLuky
Copy link

alexLuky commented May 11, 2022

When I zoom or pan some tiles just not render or whole tileset destructs until the view angle or zoom will not be changed.

Your Environment

  • itowns version used: 2.38.1
  • b3dm tiles
  • link to json: hided

Context

Here is videos to see the behavior:

  1. https://youtu.be/ei3bzoLoTrs
  2. https://youtu.be/EzqhBOsuaBs
  3. https://youtu.be/XywzT3f29ps

I've tried:

  • to set the sseThreshold = 0.3 and 100
  • tileset.geometricError = 1 and 100 and other values
    But these options don't solve the issue.

Steps to Reproduce (for bugs)

const tiles3dLayer = new itowns.C3DTilesLayer(datasetTilesSet3dObject.id, {
    name: datasetTilesSet3dObject.name,
    source: new itowns.C3DTilesSource({
      url: datasetTilesSet3dObject.url,
    }),
    sseThreshold: 1,
}, this.itownsViewer)
itowns.View.prototype.addLayer.call(this.itownsViewer, tiles3dLayer)

Expected Behavior

I expect that all tiles in camera focus will be rendered no matter the zoom or view angle.
This issue and the previous are critical for us and if there is no solution for them we'll have to avoid the itowns in our projects.

@gchoqueux gchoqueux added this to the 2.xx.x milestone May 11, 2022
@gchoqueux
Copy link
Contributor

Thanks to report this issue!
I try with your data and there's issue with itowns

@alexLuky
Copy link
Author

Thanks to report this issue! I try with your data and there's issue with itowns

Thank you very much for your involvment. We really like your product and hope the issue can be solved.

@alexLuky
Copy link
Author

@gchoqueux
is there any news about this issue?

@jailln
Copy link
Contributor

jailln commented Aug 8, 2022

Hi,
Could you share your tileset or a subset of your tileset with me? I'll try to take a look at it.

@alexLuky
Copy link
Author

@jailln
Do you have any news about the issue?

@jailln
Copy link
Contributor

jailln commented Aug 18, 2022

Could you share your tileset (or a subset of it) with me so I can give it a try? I do not reproduce the issue with the tilesets I have.

@alexLuky
Copy link
Author

Could you share your tileset (or a subset of it) with me so I can give it a try? I do not reproduce the issue with the tilesets I have.

Dear @jailln, I've already posted the link in the discussion section here: #1880 (reply in thread)

Here is the link:
https://storage.yandexcloud.net/gis-3d-models/data/tiles3d/Valaam_Aerial_Survey/Scene/Cesium.json

@alexLuky
Copy link
Author

alexLuky commented Aug 26, 2022

@gchoqueux @jailln @mgermerie
Do you have any news about this issue? Now itowns looks like it does not meet minimum industry 3D-tiles standards. All datasets that we have couldn't be used with it and there is no really effective suggestion to render the 3D tiles that itowns can work with. It looks like the dead end.

@jailln
Copy link
Contributor

jailln commented Aug 26, 2022

Hi @alexLuky,
Sorry I've missed your previous message with the link. I tested it and you just need to remove the sseThreshold parameter from your 3D Tiles layer config to make it work:

const tiles3dLayer = new itowns.C3DTilesLayer(datasetTilesSet3dObject.id, {
    name: datasetTilesSet3dObject.name,
    source: new itowns.C3DTilesSource({
      url: datasetTilesSet3dObject.url,
    }),
}, this.itownsViewer)
itowns.View.prototype.addLayer.call(this.itownsViewer, tiles3dLayer)

Cheers.

@jailln jailln closed this as completed Aug 26, 2022
@alexLuky
Copy link
Author

alexLuky commented Aug 26, 2022

@jailln
Well... it;s not solution at all... I don't know why you have closed the issue. When you remove the sseThreshold then the LOD of the models becomes awfall. Take a look at the screen. Is this ok? What should I do in this case? Open a new issue or codepen example to prove? It looks like just a come-off.
image

@jailln
Copy link
Contributor

jailln commented Aug 26, 2022

Sorry if I closed it too quickly, but it solved the initial problem you described: When I zoom or pan some tiles just not render or whole tileset destructs until the view angle or zoom will not be changed.

I will look into the level of details problem and let you know. Note that I'm on leave next week so it might happen the week after.

@jailln jailln reopened this Aug 26, 2022
@alexLuky
Copy link
Author

alexLuky commented Aug 26, 2022

dear @jailln.
Thank you very much for your envolvement.
But if you put this link to the Cesium then you'll get very good rendering result with all LODs in the propper place. But at the same time if I use this tileset for itowns I have huge rendering problems, such as bad details. This problem was described in this issue.

I've solved the light issue by refactor the MeshBasicMaterial to MeshStandardMaterial after this the light effects on gltf in b3dms and it looks much better but there is still the SSE kind of issues... and now we are in the dead-end because we can't use itowns with Cesium-standard 3d tiles based on sphere realization. I want to emphasize that this tileset works pretty good on Cesium.js but not in itowns. So we even tried to refactor the tileset.json from shpere to region. It becomes a little bit better more stable, but stil deconstructive.

Compromise solution for us could be generation our own b3dms tree from obj/gltf models but all libs that we found just make the one big b3dm without tilesets hierarchy,

Any way I think itowns should be patched to understand the cesium standard because all modern enterprise software generates the 3D tiles in this standard. In Cesium it works fine, in itowns - big issues.

@jailln
Copy link
Contributor

jailln commented Aug 26, 2022

I think I found out why the LODs (ie the child tiles) don't all get displayed:

  • Only the root tile has a refine property in your tileset (which is compliant with the spec)
  • In itowns, we only look for the refine property in the tile and in its parent (in the 3dTilesProvider.js). Instead, we should search for a refine property recursively in the parent tiles until the root tile.

I will test this lead when I get back in one week.

Regarding the discussion about the 3D Tiles support in itowns, it is a bit less well supported than in Cesium because the Cesium team are the one making the 3D Tiles standard, BUT we are working on improving this support (and your usecase helps us to do it) (see also #1867 and #1834, and there is more to come). Hopefully we can achieve a better support of 3D Tiles and benefit from the threejs features and performance + of all the other features of itowns that are not in Cesium (e.g. MVT support).

@alexLuky
Copy link
Author

alexLuky commented Aug 26, 2022

This is great news! If you will solve this and other common issues than itowns will become much more perspective framework than Cesium is.

@jailln
Copy link
Contributor

jailln commented Sep 7, 2022

Hello @alexLuky,
I've looked into it and it turned out that my first lead was not the right one. Sadly I wasn't able to fix the problem but here is what I've found out along the way:

  • Everything is fine until level 18
  • The data disappears from the scene when the level 17 should be replaced by level 18 because somehow level 18 is not displayed. It seems that they are culled out here but I haven't found out why yet and their bounding sphere seems ok. Maybe it comes from [Camera.isSphereVisible()](
  • Then, the other levels after level 18 don't get displayed
  • Setting isVisible to true makes the level 18 to get loaded and other child levels get loaded too but I'm not sure that they are displayed.
  • Level 17 objects have childrens that have no content (no uri and no mesh associated), which seems odd.

Do you now if there a structure change in the tiles at level 18 that could introduce this bug ?

I don't have time to continue looking into it this week but I will try to come back at it later on.

@alexLuky
Copy link
Author

alexLuky commented Sep 7, 2022

Greetings @jailln.
When I investigated the problem, I had a version that the reason lies in the insufficient accuracy of the calculation SSE value for the camera becuase of the possible overlapping sphere boundaries, It calculates here in the code. So perhaps we have to improve the SSE calculation for margin spheres.

I suggest you to put the dataset to the Cesium and inspect the behavior there. And then search for their implementation of SSE calculation for this case.

@jailln
Copy link
Contributor

jailln commented Sep 9, 2022

Hi @alexLuky
I also thought it came from the SSE computation at first and I actually checked the SSE computation against Cesium's one. The difference is that iTowns makes an approximation described here. Maybe we should try to replace this SSE computation to see what happens but I would rather tend to think it comes from this culling. Anyhow, the SSE computation should be more precise or the user should at least be able to choose between a precise mode and an approximated mode (faster).

I will take a look when I find some time to do it... Don't hesitate to try it also if you have time :)

@alexLuky
Copy link
Author

@jailln
is there any hopes?

@jailln
Copy link
Contributor

jailln commented Sep 28, 2022

Haven't had time to look at it yet sadly...

@alexLuky
Copy link
Author

alexLuky commented Oct 7, 2022

@jailln
how do you do?

@jailln
Copy link
Contributor

jailln commented Oct 14, 2022

@gchoqueux can you take a look at it please ? :)

@mgermerie
Copy link
Contributor

The complete 3d-tiles support is planned in the short term road map. We are currently studying possibilities in terms of libraries to enhance support (as mentioned in #1917).

@jailln jailln self-assigned this Oct 21, 2022
@jailln
Copy link
Contributor

jailln commented Nov 27, 2023

@alexLuky this should be resolved with #2143 , can you test it and let me know please?

@jailln jailln reopened this Nov 27, 2023
@alexLuky
Copy link
Author

@jailln that's great, surely I will. Give some time.

@jailln
Copy link
Contributor

jailln commented Sep 26, 2024

Closing this it has been fixed (and still works with the new OGC3DTilesLayer based on 3DTilesRendererJS). Feel free to reopen if needed.

@jailln jailln closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants