Adding Terrain Datasets for Ue4 with Cesium

Hi I’ve been trying to add local terrain data to my ue4 project to enable offline terrain loading, but I’m confused as to what is required to do this.

What I currently have:
I have the cesium terrain builder that has compiled the necessary .terrain files
The .dem files used to create the .terrain files

Hi @Richard_DelaMerced, welcome to the community!

I don’t believe .terrain files can be loaded from disk. To load them in Unreal, you’ll likely need to host and serve them locally. If you haven’t already, you should take a look at the offline data loading tutorial here: Adding Datasets – Cesium . There’s a note at the bottom with some guidance for loading terrain datasets.

If you’ve tried loading them in Unreal, is Cesium for Unreal producing any errors in the Output Log?

As a side note, Cesium Terrain Builder is not provided by Cesium. The Cesium for Unreal plugin aims to be widely compatible, but as Cesium is not involved with that tool, it may produce unsupported meshes.

-Alex

Hi @agallegos,
I’ve tried looking through the : Adding Datasets – Cesium , but I noticed it details only on 3D tiles and handling buildings. The only information on regards to loading the 3d terrain in there, is the url linking to a json file format. The format described there seems to refer to only things like buildings and other objects. Is the terrain handled in a similar fashion?

Like if I had a dem file, how would I go about using that to translate that to a cesium terrain tile set? Would I need to convert it to a certain format? Extract the information into a json file? what necessary information is needed to reproduce a terrain sample onto ue4 using cesium?

Loading it in unreal causes unreal to crash. I’m also using localhost to load in these terrain files.

I’d follow the usual tutorial for importing dem files, but I would like to keep it offline.

I’d like to add that I’m also using a local host to serve the .terrain files but it is resolving as a 404 error.

Hi @Richard_DelaMerced,

Cesium for Unreal imports tiled terrain and models. To use a DEM file, you would need to tile it using Cesium or another tool. If you don’t want to use Cesium ion, you could look into Cesium’s on-premises terrain tiler.

I can’t say without seeing your files what could be preventing the .terrain file from loading, though if you’re seeing a 404 error it sounds like there may be something going on with your server or your URL formatting. Can you share the URL that you are trying to load?

Also, you mentioned a crash - are you able to reproduce this crash? If so, can you provide any error messages or crashlogs? Unreal definitely shouldn’t be crashing, even if the file is not supported, so we’ll need to look into that.

-Alex


image

image

Unfortunately or fortunately I haven’t been able to reproduce the crashing incident.
I’m following the cesium terrain server and cesium terrain builder formats.

Hi Richard

It would be best to check with the third-party projects and tests these in the browser first just as one file, like you’ve tried in the browser. If its not working in the browser, it likely won’t work in Unreal either. Cesium for Unreal uses browser-like HTTP / CURL libraries in the backend.

Shehzan

1 Like