Manipulating Cesium content in Viewport

Hello,

I would appreciate any useful tips or solutions to a problem as I’ve just started using Cesium.
I am trying to add widgets on top of Cesium in the viewport. Due to requirements I would have to manipulate the terrain(or any imagery) to resize according to the widget so that the widget does hide any terrain/map behind it. For example in the screenshot I have a sample button overlayed on top of the map. Is there any way to resize the imagery ?

Any feedback would be highly appreciated. Thank you.

1 Like

Hi @Abdul_Jabbar, welcome to the forum!

When you say you need to resize the imagery, are you talking about preventing the tiles/areas behind the widget from loading at all?

1 Like

Hi @agallegos, thanks for getting back.
I guess what I am trying to do is pretty much is how to render cesium world terrain and imagery into a widget blueprint so I can have it as a widget ( so that we could control its size on the viewport )

1 Like

Hi @Abdul_Jabbar,

Thanks for clarifying. In that case, you’ll probably want to use a Scene Capture 2D. I’m hoping to get around to making a tutorial on using these with Cesium sometime soon, but in the meantime:

  1. Add a Scene Capture 2D actor to the scene. Position it where you want your camera (Or attach it to your pawn).
  2. In the Content Browser, add a new Render Target asset to your project.
  3. In the Scene Capture 2D’s Details panel, set the Texture Target parameter to your new render target.

Cesium for Unreal should automatically use that component to render tiles. You probably also want to enable the “Capture every frame” setting.
To put it on the widget, you can use an Image widget component and choose the render target as the source of the image.

Let me know if you have any questions.
-Alex

1 Like

Hello @agallegos I tried your above solution, I am trying to do something similar, instead of a widget, I am applying the render target material in a plane attached to the pawn. My scene capture 2D actor is also attached to my pawn. But, the output from the scene capture seems empty (white). I tried the same setup in a different Level without any Cesium landscape, and it works as expected in Unreal default scene landscape. Any idea why I couldn’t get the cesium landscape in the scene capture? Any help would be appreciated. Thanks in advance.

Hi @naren12, welcome to the community!
An all-white scene sounds like a high dynamic range (HDR) problem. Cesium scenes are often lit by realistic sunlight, which is extremely bright compared to typical Unreal lighting. This thread may have some useful tips:

1 Like

@Kevin_Ring On spot. Thank you, that worked.