Crash game when Use TMS

Hi,

I have problem with Cesium Tile Map Service Raster Overlay and nDisplay in one project. I use UE5.1.1 or UE5.2.1, Cesium plugin 1.27.1.

  1. All work fine in Editor, but when I create package project my game Crash. This is crash log:

LOG:
Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000001

0x00007ff6f9cbfb00 TMS_test.exe!tinyxml2::XMLNode::ParseDeep()
0x00007ff6f9f6ddd3 TMS_test.exe!async::detail::task_base::operator delete()
0x00007ff6f9f69597 TMS_test.exe!Cesium3DTilesSelection::TileMapServiceTileProvider::`vector deleting destructor’()
0x00007ff6f9f32e9d TMS_test.exe!async::fifo_scheduler::run_all_tasks()
0x00007ff6fa03024e TMS_test.exe!CesiumAsync::CesiumImpl::QueuedScheduler::dispatchQueuedContinuations()
0x00007ff6f9f3bddb TMS_test.exe!Cesium3DTilesSelection::Tileset::updateView()
0x00007ff6f0c0af91 TMS_test.exe!ACesium3DTileset::Tick() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\Cesium3DTileset.cpp:1983]
0x00007ff6f7c3236a TMS_test.exe!AActor::TickActor()
0x00007ff6f7c0b279 TMS_test.exe!FActorTickFunction::ExecuteTick()
0x00007ff6f906db1f TMS_test.exe!FTickFunctionTask::DoTask()
0x00007ff6f908daf5 TMS_test.exe!TGraphTask::ExecuteTask()
0x00007ff6f31e59a7 TMS_test.exe!FNamedTaskThread::ProcessTasksNamedThread()
0x00007ff6f31e5ebe TMS_test.exe!FNamedTaskThread::ProcessTasksUntilQuit()
0x00007ff6f31fc4a9 TMS_test.exe!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete()
0x00007ff6f90e6e80 TMS_test.exe!FTickTaskSequencer::ReleaseTickGroup()
0x00007ff6f90f49f9 TMS_test.exe!FTickTaskManager::RunTickGroup()
0x00007ff6f86acaa8 TMS_test.exe!UWorld::RunTickGroup()
0x00007ff6f86b85f1 TMS_test.exe!UWorld::Tick()
0x00007ff6f840556f TMS_test.exe!UGameEngine::Tick()
0x00007ff6f04706d4 TMS_test.exe!UDisplayClusterGameEngine::Tick()
0x00007ff6f03ccc8f TMS_test.exe!FEngineLoop::Tick()
0x00007ff6f03e79ec TMS_test.exe!GuardedMain()
0x00007ff6f03e7aca TMS_test.exe!GuardedMainWrapper()
0x00007ff6f03ea9d6 TMS_test.exe!LaunchWindowsStartup()
0x00007ff6f03fd704 TMS_test.exe!WinMain()
0x00007ff6fab1d0fa TMS_test.exe!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
0x00007ff80eee7614 KERNEL32.DLL!UnknownFunction
0x00007ff80fd426f1 ntdll.dll!UnknownFunction

  1. The problem occurs when I use nDisplay Plugin. This is how you can cause a problem
  • Create New Project with nDisplay.
  • Create New Map.
  • In world settings give Enable World Composing on True.
  • Compile Project
  • Add Plugin Cesium to project
  • add Cesium World Terrain with Cesium Tile Map Service Raster Overlay with URL TMS. Test TMS map here: NE2_HR_LC_SR_W_DR_recolored.tif
  • Package Project.
  • look on crash.
  • Delate Cesium Tile Map Service Raster Overlay and Package again. All Work fine.
  1. When I use Cesium without nDisplay, all work Fine.

Any idea? How to improve it?

We haven’t tested for compatibility with the nDisplay Plugin. If Cesium works on its own, then there’s not much that we can do to help you. Perhaps someone else on the forum who has used the plugin can chime in.

1 Like

Unfortunately this is a known problem. Epic claimed they planned to do the first step necessary to fix this (move tinyxml2 to a third-party module) for 5.1, but it still hasn’t happened as of 5.2.

It may be possible to work around the problem by removing tinyxml2 from the list of libraries in the CesiumRuntime.build.cs file. If you try it, let me know if it works.

1 Like

More details here:

thanks for the advice and quick reply. I will test :wink:

Hi, again.

  1. I still can’t compile TMS and nDisplay. But I will bypass this by creating a tool to convert xml to json. BUT…
  2. when I was creating the tool I noticed errors in displaying the map. I think it is problem with Cesium coordinate system. Cesium doesn’t ask UE to read the map. Show my Video:
    Cesium Error coordinate system - YouTube

Here is my tool for fast tast, compile version java8 with full code:
https://github.com/avrkwiat/Cesium_TMS_3DTiles/tree/main/dist .

Formula for calculating tile coordinates: Showing Pixel and Tile Coordinates  |  Maps JavaScript API  |  Google for Developers
Image with coordinate:
f6a0f1f3-6cac-4ca8-a104-6fa8dc054099
When increase coordinate to 10%:


I see similar problem with google maps when use polygon cut:

  1. I have a lot of questions about the hierarchical reading of 3Dtiles, but I will do it in a new post. But maybe You can share tileset.json for earth LOD0, 1, 2?

It’s hard to follow what you’re doing in that video. If you have a TMS tileset that you think should be working, and it’s not, please share it with us and we can take a look.

What’s the problem with the cartographic polygon that you’re referring to? Please walk us through the steps to reproduce the issue, preferably starting with Cesium for Unreal Samples project.

But maybe You can share tileset.json for earth LOD0, 1, 2?

I’m not sure what use this would be, but in any case it’s not ours to share. You’ll have to take it up with Google.

  1. When BoundingBox is smaller then image:
    BoundingBox miny=“48.92249926375824” minx=“11.25” maxy=“55.77657301866769” maxx=“22.5”

    Cesium displays only 1 map and doesn’t try to display other tiles (up, down, rgiht, left). But we see that google tile is smaler, then cesium tile.
    My box coordinate minimum:
    lon_deg = 17 / 25 * 360.0 - 180.0 = 11.25
    lat_deg = math.atan(math.sinh(math.pi * (1 - 2 * 21/ 25))) = 48.922499
    Coordinate max:
    lon_deg = (17+1) / 25 * 360.0 - 180.0 = 22.5
    lat_deg = math.atan(math.sinh(math.pi * (1 - 2 * (21+1)/ 25))) = 55.776573
    I use this coordinate system:
    Showing Pixel and Tile Coordinates  |  Maps JavaScript API  |  Google for Developers
  2. If we increase the area image boundingbox:
    BoundingBox miny=“48.237091888267294” minx=“7.482750073624176” maxy=“56.46198039415864” maxx="26.267249926375825
    we will get information about missing maps and now its all OK:
  3. Does cesium have a different boundingbox than googlemap? If so, it explains the problem of disappearing tiles in googlemap as we apply cartographicpolygon.
    I see the problem:

    Apply water material:

I don’t know what two things you’re trying to compare here, so I can’t answer the question. What bounding box in Cesium? What bounding box in Google Maps? The Photorealistic 3D Tiles definitely don’t use the same tiling scheme as Google’s 2D Map tiles, if that’s what you’re getting at.

  1. thanks for the last reply.
    I’ve been studying the grammar of google maps 3D tile and cesium 3D tile for the past week.
  2. what do i want to do?
    I trying to change OSG maps to cesium standard 3D tiles. I have half successful. My first 3 LOD look like this:
    https://raw.githubusercontent.com/avrkwiat/3DTiles-earth-template/main/0/L0X0Y0.json
    My grammar for mesh Tile is the same as cesium maps. LOD1:
    GramatykaL1
    LOD2:
    GramatykaL2
    Now I use boundingVolume{ region[…]}, but google map use boundingVolume( box[…]).
    I read this note: 3D Tiles Specification
    In 6.7.2.2. Bounding volume spatial coherence use sphere:
    image

Now I am trying to understand ,how to create the correct hierarchy for earth. Can I see somewhere how the first three LODs for Cesium are created?

In 6.7.2.2. Bounding volume spatial coherence use sphere:

That’s just an illustrative example. I wouldn’t actually recommend using a sphere to bound tiles in most cases. Bounding boxes and regions are usually might tighter-fitting. Tighter fitting bounding volumes mean better performance because fewer tiles need to be loaded.

Now I am trying to understand ,how to create the correct hierarchy for earth. Can I see somewhere how the first three LODs for Cesium are created?

How they’re created in what sense? I’m not quite sure what you’re looking for. There’s a very old presentation about how terrain tile generation and rendering works here:

It’s geared toward 2.5D heightmap based terrain, though. General photogrammetry-style 3D models have some extra challenges.

How they’re created in what sense? 

My LOD0 json looks like this:
https://raw.githubusercontent.com/avrkwiat/3DTiles-earth-template/main/0/L0X0Y0.json

{
   "asset": {
       "version": "1.0"
   },
   "geometricError": 5.0,
   "root": {
       "transform":
       [...],
       "refine": "REPLACE",
       "geometricError": 5.0,
       "content":{"uri":"L0X0Y0.glb"},
       "boundingVolume":
       {
           "region": [...]
       },
       "children": [
           {
               "boundingVolume":
               {
                   "region": [.... ]
               },
               "refine": "REPLACE",
               "geometricError": 2.5,
               "content":{"uri":"../1/L1X0Y0.json"}
           },
           {
               "boundingVolume":
               {
                   "region": [...]
               },
               "refine": "REPLACE",
               "geometricError": 2.5,
               "content":{"uri":"../1/L1X1Y0.json"}
           }
       ],
        "extensionsUsed":["3DTILES_content_gltf"],
        "extensionsRequired":["3DTILES_content_gltf"]
   }
}

Google maps LOD0 json looks like this:
https://tile.googleapis.com/v1/3dtiles/root.json?key=AIzaSyC_RYhB2lueN_1GAoCNXm6DVh_jBxKldhw

{
    "asset": {
        "version": "1.0"
    },
    "geometricError": 1e+100,
    "root": {
        "boundingVolume": {
            "box": [...]
        },
        "geometricError": 1e+100,
        "refine": "REPLACE",
        "transform": [...],
        "children": [
            {
                "boundingVolume": {
                    "box": [...]
                },
                "geometricError": 1e+100,
                "refine": "REPLACE",
                "children": [
                    {
                        "boundingVolume": {
                            "box": [...]
                        },
                        "geometricError": 1e+100,
                        "content": {				
                            "uri": "/v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVsa21ldGFkYXRhLnBsYW5ldG9pZD1lYXJ0aCxidWxrX21ldGFkYXRhX2Vwb2NoPTk1MyxwYXRoPSxjYWNoZV92ZXJzaW9uPTY.json?session=CNvrrciAhMnG9QEQufWHpgY"
                        }
                    }
                ],
                "extras": {
                    "comment": "path = ''"
                }
            }
        ]
    },
    "extensionsUsed": [
        "3DTILES_content_gltf"
    ],
    "extensionsRequired": [
        "3DTILES_content_gltf"
    ]
}

My LOD1 json for “uri”:"…/1/L1X0Y0.json looks like this:

{
   "asset": {
       "version": "1.0"
   },
   "geometricError": 5.0,
   "root": {
       "refine": "REPLACE",
       "geometricError": 5.0,
       "content":{"uri":"L1X0Y0.glb"},
       "boundingVolume":
       {
           "region": [...]
       },
       "children": [
           {
               "boundingVolume":
               {
                   "region": [... ]
               },
               "refine": "REPLACE",
               "geometricError": 1.25,
               "content":{"uri":"../2/L2X0Y0.glb"},
               "children":
                 [   {
                         "boundingVolume":{
                         "box":[...]},
                         "geometricError":1e+100,
                         "content":{"uri":"../2/L2X0Y0.json"}
                     }
			 ]
           }
,           {
               "boundingVolume":
               {
                   "region": [... ]
               },
               "refine": "REPLACE",
               "geometricError": 1.25,
               "content":{"uri":"../2/L2X0Y1.json"}
           }
,           {
               "boundingVolume":
               {
                   "region": [...]
               },
               "refine": "REPLACE",
               "geometricError": 1.25,
               "content":{"uri":"../2/L2X1Y0.json"}
           }
,           {
               "boundingVolume":
               {
                   "region": [...]
               },
               "refine": "REPLACE",
               "geometricError": 1.25,
               "content":{"uri":"../2/L2X1Y1.json"}
           }
       ],
        "extensionsUsed":["3DTILES_content_gltf"],
        "extensionsRequired":["3DTILES_content_gltf"]
   }
}

I can see google maps structur for LOD1 use URL:
https://tile.googleapis.com/v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVsa21ldGFkYXRhLnBsYW5ldG9pZD1lYXJ0aCxidWxrX21ldGFkYXRhX2Vwb2NoPTk1MyxwYXRoPSxjYWNoZV92ZXJzaW9uPTY.json?session=CNvrrciAhMnG9QEQufWHpgY&key=AIzaSyC_RYhB2lueN_1GAoCNXm6DVh_jBxKldhw

I can download all LOD json structur for google 3D Tiles. Here is description how: Praca z wĹ‚asnym mechanizmem renderowania kart 3D  |  Google Maps Tile API  |  Google for Developers

My question is:
Is there any easy way to download the first few json for Cesium map?

Accessing any asset on Cesium ion starts with a request to the “endpoint” service, which is documented here:

If by “Cesium map” you’re talking about Cesium World Terrain, it uses the older quantized-mesh terrain format rather than 3D Tiles. That is documented here:

1 Like