Acces Cesium World Terrain components

Hello everyone,

I’m working on a Cesium for Unreal project and I’m wondering if it’s possible to access the components of Cesium World Terrain through C++ from a class other than its own class (Cesium3DTileset)."
(for example, I want to access the instanceWMS component in this case)
image

Thanks in advance!

Sure, raster overlays are just regular ActorComponent instances. You can get all of the raster overlays attached to a tileset using some code like this:

Cesium3DTileset* Tileset = ...;
TArray<UCesiumRasterOverlay*> rasterOverlays;
Tileset->GetComponents(rasterOverlays);

Thank you for your answer @Kevin_Ring ! I’m sorry i’m new to this, but how can I initialize Tileset for example ?

The Unreal forums are good for questions like this, because it’s not really related to Cesium for Unreal at all. For example, this post summarizes some of your options:

It’s also possible to get Actors from the world by tag by using UGameplayStatics::GetAllActorsWithTag.

Thank you so much @Kevin_Ring , this has been really helpful! I do have another question related to Cesium. Let’s say I am now able to choose which layers to show and hide, as shown in the image below.

image

However, I would like to add another parameter to control the layer appearance order. For example, I want to show layer3 on top of layer1. Is there a specific parameter in Cesium WMS (or in raster overlay in general) that allows me to do this?

Thank you in advance!

The property is Material Layer Key. In the default material, Overlay0 is shown on the bottom, Overlay1 on top of that, and Overlay2 at the top. You can customize the material, though. This tutorial has more detailed information about that:

Thank you !!

I have a question regarding the water mask option in Cesium World Terrain. Specifically, I’m curious about how it’s implemented. I’ve noticed that it doesn’t seem to work when I change the terrain, and only works on the default Cesium ion terrain. Are there specific parameters or criteria that need to be met in order for it to function on my terrain? Thank you for your help.

It only works with quantized-mesh terrain, and only if the terrain tileset has a water mask:

For rendering water on other tilesets, you could use a raster overlay for the water mask and a custom material to render water in the areas indicated by the mask.