Framerate much lower in packaged build on Oculus for TextureRenderTarget2D for spectator camera

This issue have been reported as UE-70352.

Below is a description to reproduce the error as the description on issue tracker is incomplete.

Description:

I tried to implement a spectator for my app by using TextureRenderTarget2D and discovered a weird bug.
Everything works fine in the editor, BUT as soon as I package my project the frame rate drops really low (<15fps, sometimes less than 5 fps).

This is a bug related to Oculus somehow, because when I try running the packaged project with my HTC Vive everything works as expected.

Steps to reproduce:

  1. Start a new project with starter content.
  2. Check “Start in VR” in project settings.
  3. Add a TextureRenderTarget2D to the project, set the size to 1920x1080.
  4. Open level blueprint and add the following to “Begin Play” event:
  • “Set spectator screen mode” and set it to “Texture”

  • “Set spectator screen texture” and set it to our TextureRenderTarget2D.

  1. Add a “SceneCapture2D” to the project and set its target texture to our TextureRenderTarget2D and its capture
    source to “Final color”
  2. Package the project

The frame rate will be fine inside the editor. But the frame rate for the packaged project will be very low. It becomes very visible when turning the head from side to side.

The bug have been present since version 4.19 (at least) and is still present in the 4.22 preview version.

I can confirm this bug in 4.22. I am not certain the bug is actually low frame rate though. For me I am achieving 60+fps in a packaged build with a scenecapture2D, but my VR headset will never lock at 45fps with ASW. It’s like the scenecapture2D is preventing the headset from locking the FPS at 45 or 90. I have tried all the smooth frame rate options to no avail. r.vsync 1 also does not fix the issue

The bug is said to be fixed in 4.23, however, I still have the problems described. Can anyone confirm this?

@ndelchen I just tried the above procedure with the 4.23 and I can confirm that the bug is still present.

@anonymous_user_b677394b Bummer :frowning:

I have made a short video demonstrating the issue:

Exactly the same for me, also with Oculus in 4.23. They might have done their tests using the Vive or so, since the issue tracker doesn’t say anything about Oculus, just VR.

@ndelchen I got a suggestion in another thread about a workaround.

Using the below level blueprint works for me:

@anonymous_user_b677394b Looks promising, will test that and let you know! Thx!