The correct solution for this is to simply set r.SceneRenderTargetResizeMethod to 2 instead of the default of 0 when there are intermediate render targets used for scene captures.
Using SceneCapture in packaged VR projects causes poor performance.
Also observed with SceneCaptureCube
Does not occur in 4.18
1. Create a new project in 4.19
2. Create a RenderTarget2D in the Content Browser. Set it to 256x256 size. Any size will work as long as it's different to native HMD resolution. Eg, anything other than 2720x1600 for Oculus.
3. Make new Starter map, place a SceneCapture2D in it, and assign the RenderTarget to its TextureTarget property. Ensure CaptureEveryFrame and CaptureOnMovement are both ticked. (Or alternatively, manually call CaptureScene() every Tick).
4. Launch a "VR Preview" PIE session. Note the framerate should be smooth.
5. Make a packaged build in the Development configuration, launch it. The framerate should drop due to RenderTarget allocation every frame. In Shipping configuration, framerate is still lower than PIE.
Close the packaged build, and check its generated log file. There should be lines resembling the following, output every frame.
[2018.05.10-00.43.43:520][982]LogRenderer: Reallocating scene render targets to support 256x256 Format 10 NumSamples 1 (Frame:6984). [2018.05.10-00.43.43:540][983]LogRenderer: Reallocating scene render targets to support 2720x1600 Format 10 NumSamples 1 (Frame:6984). [2018.05.10-00.43.43:540][983]LogHMD: Allocating Oculus 2720 x 1600 depth rendertarget swapchain [2018.05.10-00.43.43:579][984]LogRenderer: Reallocating scene render targets to support 256x256 Format 10 NumSamples 1 (Frame:6985). [2018.05.10-00.43.43:579][984]LogRenderer: Reallocating scene render targets to support 2720x1600 Format 10 NumSamples 1 (Frame:6985).
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-59090 in the post.
13 |
Component | UE - Platform - XR |
---|---|
Affects Versions | 4.19.2 |
Target Fix | 4.20 |
Created | May 14, 2018 |
---|---|
Resolved | May 18, 2018 |
Updated | Mar 9, 2020 |