Multiple Simultaneous Camera Rendering

Hi Cesium team and community!

Our team is working on an application that utilizes the Unreal engine (5.4) to view satellites around the Earth, using a real-scaled Earth model. We have successfully implemented Cesium into our application and being able to move around the Earth and load in the Cesium tiles according to the player’s viewport has been relatively issue-free.

However, satellites in orbit may have cameras looking down or in the direction of the Earth. If the observer (or player pawn) is on the other side of the Earth, the camera view (which may be saved to disk or shown in a separate window), has tiles that are not streamed or have a low LOD.

It is my understanding that Cesium selects the first player controller to register the ‘Cesium Camera’, but I have not been able to find online an example or document explaining how to have simultaneous camera views looking at the Earth (all in potentially different locations). To confirm, I don’t just want multiple cameras looking at the same tile set; I want each camera to appear to have a fully loaded tileset within its frustum.

If anyone has any suggestions, that would be much appreciated.

Thanks,
Harrison

Hi @harrison, welcome to the community!

Cesium for Unreal discovers the cameras for tile selection with this code:

So, by default, it will use the cameras attached to player controllers and ASceneCapture actors. If you need additional cameras, you can use the Blueprint or C++ API provided by the CesiumCameraManager Actor to do so.

1 Like

Hi Kevin,

Thank you for the reply - this was the exact bit of code I needed to see!

For anyone else stuck, I did the following:

  1. Created my own Camera Manager instance (or use the one spawned)
  2. Connected the camera manager to my Cesium Tileset
  3. Used the AddCamera function on the Camera Manager to add a camera for each of my camera objects
  4. Updated the camera struct (Location, Rotation, FOV, etc) in each frame on a Tick using the UpdateCamera function on the Camera Manager

Thanks again for your help :slight_smile:

3 Likes

Hi, harrison.

I am trying to follow your steps and advice in other threads on the topic. I have a blueprint, Cesium Camera Manager, Camera, and Camera Manager added to Google Photorealistic 3D Tiles. But this scheme doesn’t work for me, errors constantly pop up in the log saying that Anreal can’t see (can’t find the camera object). Maybe I don’t quite understand how it should work and I have errors in the blueprint or in what I’m doing. Could you help me?

Blueprint runtime error: “Accessed mome trying to read (real) property CameraManager in BP_2_4”. Node: updateCamera Graph: EventGraph Function: Execute Ubergraph BP 2 4 Blueprint: BP_2_4

Hi @cert183,
I can’t see any errors in your Blueprint screenshot. It may help to share a screenshot or exact copy/paste of the error.

Hi, cert183,

1. Ideally, the “Custom Event” should be replaced with “Event BeginPlay”. It is also recommended to add a “Delay” node before “Get Default Camera Manager” to ensure that the reference is properly obtained.

2. Right after the “Set Camera ID” node, set a Boolean variable,for example, named “Cameras Added”, to True (it should be initialized as False). It will be used within the “Event Tick”.

3. “Event Tick” executes the “Update Camera” only when Cameras Added is True; otherwise, take no action.

Hi, Kevin.
Thanks for reply!

I changed the blueprint that was used to pre-render the scene, and everything seemed to be fine, but now the pre-render has stopped working. I would also like to ask how I can add several pre-render cameras to this script, because, from what I understand, it turns out that there is nowhere to add the camera in the middle of the script, and several “custom event” nodes will not work either?