Skip to content

Generate navigation mesh on Cesium3DTileset #1044

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

Merged
merged 6 commits into from
Mar 30, 2023

Conversation

Project-PLATEAU-Admin
Copy link
Contributor

This PR accommodates #327. The latest version(v1.22.0) of Cesium for Unreal can not generate a NavMesh for a Cesium3DTileset
actor. However, this PR make it possible to generate a NavMesh on a Cesium3DTileset actor.

We have confirmed that NavMesh is generated after our modification using the "New York City 3D Buildings" asset provided by
Cesium Ion. The first image is before our modification and the second image is after our modification.

BeforeNavCollision
BeforeNavCollision

AfterNavCollision
AfterNavCollision

@cesium-concierge
Copy link

Thank you so much for the pull request @Project-PLATEAU! I noticed this is your first pull request and I wanted to say welcome to the Cesium community!

The Pull Request Guidelines is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that.

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

@kring
Copy link
Member

kring commented Feb 28, 2023

Thanks for the pull reuest @Project-PLATEAU! Have you looked at the performance impact of this change at all? Is it nearly zero as long as the user isn't using navigation? And if users are using navigation, are the rather large - and also dynamically added/removed! - 3D Tiles meshes very usable with navigation? Does it cause Unreal to do extra work when the tiles are added? If so, does it do that work in the game thread?

@Project-PLATEAU-Admin
Copy link
Contributor Author

If users do not use navigation there was no performance impact.
We assume that this fix is not for dynamically deleted meshes, but for 3DTiles meshes, such as buildings, where the character is moved by navigation after all models have been loaded. Therefore, this fix requires that "KeepWorldOriginNearCamera" be set to False. Without the above setting, the 3DTiles will move as the camera moves, which will cause differences in the coordinates of the generated NavMesh.
Navmesh generation is executed in the game thread. However, if Runtime Generation setting of Navmesh is set to Static, Navmesh generation is executed only once and does not affect performance during gameplay.

@kring
Copy link
Member

kring commented Mar 6, 2023

We assume that this fix is not for dynamically deleted meshes, but for 3DTiles meshes, such as buildings, where the character is moved by navigation after all models have been loaded.

This seems like a fairly unlikely use-case to me. It's rare for a 3D Tiles tileset to be loaded completely and then never changed. A large reason to use 3D Tiles at all is to do hierarchical level-of-detail at runtime. Otherwise, you could just import the entire model into the Editor and be done with it, right?

I think we at least need an option to skip generation of nav meshes for 3D Tiles. My worry is that this a) isn't that useful in typical 3D Tiles use-cases, because it's too slow, and b) will break people that are using hand-crafted nav meshes (or nav meshes derived from non-Cesium models, anyway) in levels that incorporate 3D Tiles. Such levels will suddenly start trying to generate nav meshes for large 3D Tiles, thereby breaking a level that used to work fine.

@Project-PLATEAU-Admin
Copy link
Contributor Author

Your concerns make sense. However, it does useful when a 3DTileset of a small area is used for simulation, as in our case.
So, we have made a modification to make this feature optional.
Could you confirm the commit we added?

Our case could be found on the following page:
https://www.mlit.go.jp/plateau/use-case/uc22-030/

@kring
Copy link
Member

kring commented Mar 14, 2023

Thanks @Project-PLATEAU. Your latest changes are ok with me, and I'm happy to merge that. Quick question though: would it be better to have a per-tileset option to control whether the tileset supports nav meshes, rather than the experimental feature flag? This would be similar to the existing "CreatePhysicsMeshes` option, and allow users to, for example, enable navigation for a smaller local model while disabling it for the background Cesium World Terrain tileset.

@kring
Copy link
Member

kring commented Mar 24, 2023

Just a reminder about my question above, @Project-PLATEAU. What do you think?

@Project-PLATEAU-Admin
Copy link
Contributor Author

As you commented, we think it would be better to have this setting in each of the 3DTileset actors.
We have removed it from the experimental feature flag and added the flag to the navigation category of the 3DTileset actor.
Could you please confirm this?

@kring kring merged commit cd68081 into CesiumGS:ue4-main Mar 30, 2023
@kring
Copy link
Member

kring commented Mar 30, 2023

Thanks @Project-PLATEAU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants