Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frustrum culling does not account for different aspect ratios (In Sequencer) #680

Open
argallegos opened this issue Nov 3, 2021 · 13 comments · Fixed by #708
Open

Frustrum culling does not account for different aspect ratios (In Sequencer) #680

argallegos opened this issue Nov 3, 2021 · 13 comments · Fixed by #708
Labels
bug Something isn't working

Comments

@argallegos
Copy link
Contributor

From the forum: https://community.cesium.com/t/rendering-from-sequencer-in-portrait-aspect-ratio/15855

When using Sequencer and Movie Render Queue, frustrum culling does not work correctly for tall aspect ratios.

0d3f2bedefbd03ffeeb73ab0704002642fa339fa

Not sure if this applies to non-sequencer vertical aspect ratios - we should test further.

@argallegos argallegos added the bug Something isn't working label Nov 3, 2021
@kring
Copy link
Member

kring commented Nov 3, 2021

This is likely the same as or similar to #667.

@cmontero3d
Copy link

Just wanted to confirm that this version of the bug (Sequencer) was not fixed by #667 - tested with last weeks Build.

@kring
Copy link
Member

kring commented Jan 13, 2022

This is not completely fixed yet, because getting the viewport size from the movie render queue system is really difficult. See https://udn.unrealengine.com/s/question/0D54z00007LQvtdCAD/how-to-get-the-viewport-size-when-using-the-movie-render-queue

@kring kring reopened this Jan 13, 2022
@kring
Copy link
Member

kring commented Jan 18, 2022

Based on the conversation with Epic above, the current best plan I can think of is this:

  1. Create a new plugin, "Cesium for Unreal Movie Render Queue Support" or somesuch. This will have to be separately published to the Epic Marketplace, and separately installed by the user.
  2. Create a custom MRQ settings class in the new plugin. Use it to detect when a MRQ render starts, and extract the camera details. Ideally we'd be able to "install" these custom settings automatically, but it may not be possible. In which case the user will have to add our settings class manually when they set up a MRQ render.
  3. Use Unreal's "module features" system to make the new plugin publish a feature to provide the MRQ camera details. We'll also have built-in implementations of the feature to get camera details from the Editor and from the regular game objects. Basically camera detection in all scenarios will happen through a feature interface.

This will probably take at least a few days to implement, maybe longer.

Ideally we'd convince Epic to update the PlayerController's viewport parameters in MRQ mode, so we wouldn't have to jump through these hoops. But a) this might be totally unrealistic for reasons that aren't obvious to me, and b) even if that's done, it won't work in any already-released versions of Unreal Engine.

@shehzan10
Copy link
Member

  • Create a new plugin, "Cesium for Unreal Movie Render Queue Support" or somesuch. This will have to be separately published to the Epic Marketplace, and separately installed by the user.

@kring Does it have to be a separate plugin, since that adds some overhead? It may not be completely aligned with Cesium for Unreal's vision and goals, but it could be nice if we didn't have the maintenance overhead.

@kring
Copy link
Member

kring commented Jan 20, 2022

Yes it has to be a separate plugin @shehzan10, otherwise the Cesium for Unreal plugin would have a hard dependency on the Movie Render Queue plugin.

@shehzan10
Copy link
Member

@kring Makes sense, thanks.

@MuckYu
Copy link

MuckYu commented Jul 2, 2023

Is there any update on this issue?

It seems the bug is still present for me. Is there any workaround?

@kring
Copy link
Member

kring commented Jul 3, 2023

No, because as far as I know Unreal still doesn't provide an API to query the information we need from the Movie Render Queue. However, you can work around it by using Blueprints to manually call AddCamera and UpdateCamera on the CesiumCameraManager Actor with the parameters of your camera. See #734. Alternatively, you can avoid using Movie Render Queue.

@MuckYu
Copy link

MuckYu commented Jul 5, 2023

So in level blueprint. Event BeginPlay => Default Camera Manager => Add Camera (Make CesiumCamera) => Update Camera

Is that all I need? Or any more nodes?

And how do I get this camera into the sequencer? Since it does not yet exist

@kring
Copy link
Member

kring commented Jul 6, 2023

You'll need to pass accurate camera parameters into Update Camera, of course.

@MuckYu
Copy link

MuckYu commented Jul 6, 2023

cesiumcamera

Here is my current setup. I put random numbers here as a test to see if it updates. It does not change the camera settings at all in the renders.

I then try one of the following:

  1. In the level sequence I then drag and drop the CesiumCameraManager. Then hit render in the MRQ. However it will render the position of the DynamicPawn object instead. The bottom of the tiles are missing => it didn't use the camera settings from the blueprint.

  2. I copy the settings from another camera that I created into the camera settings in the level blueprint. In the level sequence I drag and drop the Camera that I created previously. In MRQ I hit render. It renders the position of the camera but the tiles at the bottom of the image are not showing.

My aspect ratio is 1:1
Culling enabled

Here is the result

result aspect ratio

@kring
Copy link
Member

kring commented Jul 7, 2023

I put random numbers here as a test to see if it updates. It does not change the camera settings at all in the renders.

Sure. Creating a virtual camera with some random location and direction isn't going to affect anything. The Camera Manager doesn't actually change the camera that is used to capture video. It is just a way to tell Cesium about the camera you care about so that it can load the right tiles. You have to feed it accurate information about your camera, or else it will not be helpful at all.

In the level sequence I then drag and drop the CesiumCameraManager.

No need to add the camera manager to your sequence. That won't do anything useful.

I copy the settings from another camera that I created into the camera settings in the level blueprint.

It may help to share your Blueprint. This sounds like the right approach, and it looks close. But maybe the orientation is just a bit off.

It's worth stopping to see if you really need to do any of this, though. What problem are you actually trying to solve? Before you started messing with the camera manager, were you seeing frames like the one in your last screenshot, where part of the screen looks correct, but on one or more edges there are tiles missing? If so, using the camera manager may help.

But if the problem is that the images are missing tiles sporadically (i.e. in the middle, not just at the edges), or if they're a lower than expected level of detail, then the problem may simply be that the movie render isn't waiting for tile loads before snapping frames. You should be able to easily solve this just by making sure your Level Sequence is in your level (not just an asset in the content browser). No need to use the Camera Manager at all. See here: https://community.cesium.com/t/ue-5-1-rendering-with-movie-render-queue-tiles-not-loading-in-time/24954/6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants