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": - "Set spectator screen mode" and set it to "Texture" - "Set spectator screen texture" and set it to our TextureRenderTarget.
Add a "SceneCapture2D" and set its target texture to our TextureRenderTarget and its capture source to "Final color"
Package the project
The frame rate for the packaged project will be very low. I becomes very visible when turning the head from side to side.
I have reported the bug to Epic, but the bug have regretfully been placed as a low priority backlog issue. Maybe someone at Oculus could look at it, since it seems that only Oculus Rift devices that is affected.