cesium-unreal icon indicating copy to clipboard operation
cesium-unreal copied to clipboard

UE5 Support: Explore alternatives to georeferenced sublevels

Open nithinp7 opened this issue 3 years ago • 7 comments

In UE4, we used world composition to enable georeferenced sublevels. World composition is typically used to arrange sublevels on a grid so they can be loaded in or out based on where the player is on the grid. But in our case we always spawn the sublevels at the Unreal origin so we didn't need this feature. We only used world composition to explicitly tell the level streaming system that these sublevels are not to be streamed in according to distance, instead our georeference system should control when levels should be loaded from C++.

In UE5, world composition has been removed and replaced with world partition. There is also a level instancing feature which can be used outside of a world partition system as long as a custom streaming management logic is provided, this sounds like exactly what we want (reference here). Level instancing also adds the ability for levels to have arbitrary transforms and since this is UE5 I assume these transforms can be in double precision. In some cases, this may remove the need for the georeference origin changing that currently happens when switching levels, but for the foreseeable future it will usually be more convenient to spawn sublevels at the origin and change the georeference.

In general, we should investigate if it would be possible to have the Unreal coordinate system directly represent ECEF. If so, we should provide that as an alternative option to using the georeference system. This includes providing alternative code paths for Cesium objects to be correctly located when UE coordinates represent ECEF.**

**Technically UE coordinates will be left-handed, Z-up, and in centimeters, so not exactly ECEF, but equivalent up-to a simple conversion transform.

nithinp7 avatar Jan 19 '22 15:01 nithinp7

Hi, this is exactly what we're looking for in the cesium / unreal development we are working on for the AEC sector.. is this likely to be developed soon please?

ghost avatar Mar 19 '22 15:03 ghost

Hi @UnrealVistas, this issue is more to "investigate/explore" than to implement anything concrete. If you can tell us a bit about what problem you're running into that you think this might help you solve, that would be very helpful.

kring avatar Mar 19 '22 23:03 kring

Hi, we would like to be able to 'sculpt' the cesium tiles directly but as this is not currently possible one alternative is to overlay a DEM landscape and coincide it with the cesium coordinate system. We were hoping that by using the georeferencing plugin this may be possible but clearly not. I though this issue was a first attempt at making this possible.

ghost avatar Mar 20 '22 06:03 ghost

I think it may be possible. I haven't used the Georeference plugin much, but I think that as long as you set the Georeference plugin and the CesiumGeoreference to the same origin, you should be able to use the former to control the georeferencing of a DEM and the latter to control the georeferencing of a Cesium tileset. And then use a Cartographic Polygon to remove the the part of the Cesium tileset that you don't want to use.

This issue (among other things) suggests that we might be able to replace the CesiumGeoreference with the Georeference plugin. But there's currently nothing stopping you from just using both as long as you manually make sure they're in agreement.

kring avatar Mar 20 '22 21:03 kring

It looks like the world partition system has a number of plug-in points that might allow us to make it work in a globe coordinate system, rather than the 2D grid it ships with. For example, UWorldPartitionStreamingPolicy and UWorldPartitionRuntimeCell (both abstract). Lots of investigation required, though.

kring avatar Mar 28 '22 05:03 kring

A couple of people in the community forum have asked for the ability to create sublevels at runtime, rather than at Editor time. It's worth considering this when we next revisit this system. https://community.cesium.com/t/creating-streaming-levels-at-runtime/18071

kring avatar Apr 08 '22 02:04 kring

Interested to know the status on this topic? as we are using World Partition and would like to integrate Cesium. Although WP has it's bugs, I think things are being ironed out with imminent 5.1 release

rossoe avatar Sep 26 '22 10:09 rossoe

@nithinp7 @kring Any update on World Partition with Cesium?

lukemadera avatar May 15 '23 16:05 lukemadera

Not yet, but I am hoping to begin work on some sublevel improvements this week. As you know, our sublevel system is currently based on World Composition, which is deprecated. Most likely we won't switch to World Partition, though. Instead, we'll switch to something like we did in Cesium for Unity where we enable and disable Actor subtrees without using a specific Unreal system. And users can layer a dynamic loading/unloading system of their choice on top of that if desired. Even though world partition sounds like it's solving a similar problem, I don't think it's particularly well suited to a round, 3D world, as the world partition grid is 2D.

kring avatar May 15 '23 20:05 kring

Ok, thanks for the prompt reply!

lukemadera avatar May 16 '23 02:05 lukemadera

Is the recommendation therefore to create Cesium Levels in a Basic World without World Partition? I created mine with World Partition, and whenever I try to open the World Partition pane, the Editor loads unlimited data in Memory and crashes with a Fatal Error...

brybalicious avatar Jun 02 '23 00:06 brybalicious

We just fixed a bug that caused a crash when using Cesium Actors with World Partition. So try updating and see if that helps.

But basically, yes, avoid World Partition for now. It's probably not very useful with a round world anyway.

kring avatar Jun 02 '23 01:06 kring