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:
- Start a new project with starter content.
- Check “Start in VR” in project settings.
- Add a TextureRenderTarget2D to the project, set the size to 1920x1080.
- 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.
- Add a “SceneCapture2D” to the project and set its target texture to our TextureRenderTarget2D and its capture
source to “Final color” - 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.