Terrain in Cesium for Unity

Hello, i’ve been playing with cesium for unity and i’m trying to use our custom terrain server which serves cesium terrain in heightmap and qmesh format (we use it in cesium web clients without problems). But its not working. Is terrain in cesium for unity also expected to be in 3D Tiles format?


I believe we only expect terrain to be in 3D Tiles format. Unlike CesiumJS, there aren’t separate terrain provider classes and we load everything as a Cesium3DTileset. @Kevin_Ring maybe you can verify when you get back?

Cesium for Unity does support terrain in quantized-mesh format, but not heightmap format. One difference compared to CesiumJS is that you must specify the full URL to the layer.json file in Cesium for Unity, whereas with CesiumJS you just provide the base path and it adds the layer.json automatically.

Hi @Kevin_Ring , I’ve been banging my head for two days now trying to figure out why this terrain data won’t display in Unity. I point the default Cesium World Terrain object Tileset Source to the layer.json contained within. Everything appears to parse fine (no errors in console). But the terrain isn’t visible and enabling “Show Tiles in Hierarchy” doesn’t show any tiles in Unity’s hierarchy either.

When using the source “From Cesium Ion” the terrrain shows up in Unity as pure white (and does make tiles). The Ion Asset ID for the terrain is: 1679236
11622.zip (12.2 MB)

It’s normal for terrain to appear pure white, as it does not include any textures. It’s the shape of the surface only. To add textures, you need to add a raster overlay component. Bing Maps is a popular choice for satellite imagery, and can be added from the Cesium ion Assets panel.

I just tried the terrain in the ZIP file you attached, and it seems to work correctly. As you suggested, I started with the Cesium for Unity Samples project and modified the Cesium World Terrain object in the 01_CesiumWorld scene. I switch the source from “From Cesium ion” to “From URL” and put the path to the layer.json in the URL field. Like this:

And the globe appeared as expected, with Bing Maps draped over it.