Scene Capture 2D performance issue. (120 to 70 FPS drop)

Im using Final Color capture source with post process material to remove background. There is 1 static mesh and 1 skeletal mesh set to capture. Any possible solutions?

The problem becomes noticable in a packaged game. In editor everything at least seems to be fine.

Do you mean a render target? The problem with them, is you’re basically rendering the world twice. So 120 to 70 sounds about right :melting_face:

The smaller you can make your render target, without looking bad, the better the performance will be.

Also turn the SceneCapture off when not being used.

Well, there are no any solutions to make SceneCapture2D just to render the components I want it to? I gotta make my custom capturer?

1 Like

Im taking PUBG as an example, their 2D character in inventory has high resolution, and does not cause FPS issues


Often, you’d construct an inaccessible, beautifully lit room, place pertinent stuff there and capture it.

2 Likes

As @Shmoopy1701 says, smaller the better. Also, I assume if you do it in CPP, you can take more shortcuts…

Exacty what im using. I only have 2 components there. In unpackaged project its all good, but in a packaged version GPU STAT shows unacceptable raise from 7 to 12. The only additional thing i use is my post process material to remove background out of the Final color capture source, but it does not affect performance. And yeah, i cannot change the size of the image, it has to be exactly the same size as a space it takes on screen.

Strange. I’m doing a capture in game and it’s not affecting performance much (maybe 10 fps reduction). Just tried it in a packaged build.

I called SetVisibleInSceneCaptureOnly(true) on the static mesh components. I also used the second light channel (turning off the first channel) for the camera and assets being captured. I updated the main lights to also support the second light channel.

You could also try “Max View Distance Override”.

Ohhh… I forgot I also disabled “Cast Shadows” on the directional lights that are used only for the capture as there’s only one actor and I’m already getting shadows from the main light. Turning on shadows in my two directional lights reduced my fps by another 20 fps. So total reduction of 30fps.

And if you have “Cast Cloud Shadows” on any directional light, your performance will tank.

Well, it didnt help. I switched 0 lightning channel to a 1st one, only added a single lightning source there (point light) and made my meshes to be visible only in a scene capture, max distance is 1000. Didnt help, i still get drops from 90 to 50 fps when i place second capture, and 160 to 90 when i place first capture. Still just 2 meshes.

My capture resolution is 1420 x 1680 (even if i set it to be 200 x 200 it still does 160 to 100 fps drop tho), and i cant set it lower cuz the image’s quality will get potatoed. And my custom solution in C++ eats even more FPS than a scene capture, so i guess ill just try to find some other methods to add a 3D model into a widget.

With Capture:

Without:

Here what causes the problem, TSR (which is a Scene capture itself in that context i guess)

Also, i get 140 → 110 fps drop EVEN when every single show flag is disabled, and my texture’s resolution is 1 x 1. I think that this might be some bug. The texture aint being used nowhere, and to test i just turn on and off the Capture Every Frame setting. Again, in a Built version of the game

WOW! 5ms for TSR is crazy. Maybe TSR doesn’t play well with capture cameras?

I don’t use TSR. It was too slow for me overall (even without captures) and I find TSR is terrible for straight edges. I have a lot of hard edges in my game so I switched to TAA. But in my capture camera, I have TAA disabled. I think it uses FXAA instead.

Is there an option to turn off TSR in your camera? It should be in the “Advanced Show Flags”. Maybe it would still have acceptable quality. If you absolutely want to stay with TSR in your captures then I don’t know.

I looked at my stats. I have a screen with 3 captures (One actor each with lots of Niagara effects). I’m getting high times on Basepass (3), ScreenSpace AO (1.5) and all lights. TAA is 0.4. Postprocessing is 1. Still getting 60-70 fps. In game with one capture, I’m getting well over 90 fps. 100-110fps without capture. The only difference in stats were lights.

Now I have to look up what Shadow Depth is. I’m getting 5ms in game.

edit: Ah, I’m now seeing your post that you turned off all the show flags. Was there one to disable TSR? That did nothing?

I dont really think that TSR in that situation means anti aliasing to be honest, this might be some kinda compression of an image. I tested with both FXAA and TAA, same results. Here are the results with EVERY single flag disabled (literally shows nothing right now) and a SINGLE pixel resolution ( 1 x 1) of a texture.|

Without (FPS 130)

With (FPS 100)

Almost zero changes as you can see, but my FPS is being stolen :man_shrugging:

Is anything else using your GPU? Have you rebooted lately?

Might want to try the trace tool. Might be CPU bound. It’ll show you every function that’s being called and the total time for each.

Well, testing on an RTX 4090 and I9 14 gives pretty same results but scaled. Current PC that is used in displayed tests is an RTX 2060S with I3 10100f. Im gonna test it in a pure project as well, but i think it will give me the exact same result.

Edited: yup, same issue

So, the most simple solution i came up with is to disable rendering in menu. And thats all.
image

Scene capture will stop working as well, so you have to call CaptureScene every tick.

Yes, if you are using the scene capture for an equipment menu mannequin (like in PUGB) then the scene captures should be turned off whenever the menu is not visible. If used, then scene captures must be very strictly managed. :+1: