Unreal Engine Livestream - Creating a VR spectator camera - Feb 21 - Live from HQ

@Gabe23K Not at all! That’s what these announcement posts are for :slight_smile:

You can’t use the regular mouse cursor because we’re already hacking it by adding a 3dwidget component in front of the camera. My theory as to why it goes off the screen is probably because it’s trying to operate within the screenspace of what’s being rendered to the HMD, and not in the render target texture that’s being displayed on the flat monitor.

Yeah, I imagined. But no worries.

I ended up going a bit deeper with my research and found a solution for the mouse cursor. Using the widget render target as the texture for the Spec Screen instead of adding it in front of the camera and Setting the Relative location of the widget interaction instead of just adding to it. It was rather satisfactory merging both, your approach and the other one, into a solution for this.

Thanks for the hard work and the reply!

Hey, this is awesome! Is it possible to use this approach with local split-screen? Multiple scene captures combined to a single spectator screen? 1 VR player vs 4 on-screen players?

Not out of the box, and it would be difficult to get four scene captures and the stereo rendering to hit required performance.

Hello! Maybe a little late here, but I’m having some issues implementing the VR spectator camera on a very simple packaged project without hits to performance. I can run the sample in the editor, but once I package it, the performance drops fairly dramatically. I’m looking into settings for optimization, but this is pretty much out of the box as far as I’m aware. Even if I keep the render texture lower that 1920x1080 (I kept it to the default 256x256) I still saw issues. Any help would be really appreciated!!

Hi just a little bit of a clarification to my last comment. I believe I narrowed down my “performance” issue. It seems when I run package and run this project, I’m getting what appears to be a memory leak with my RAM rising quite quickly. I’ve attached a screenshot of my task manager after running the packaged build for just 30-60 seconds.

A couple things I had to do to get the project running for myself:

  1. In project settings enable start in VR
  2. In the Enable Spectator Screen function, instead of *Is Head Mounted Display enabled? *I needed to use Is Head Mounted Display Connected or just skip that check all together. Otherwise, when I’d run the packaged project, it would log No HMD detected: Debug Mode etc.

A couple extra notes. I do not seem to have an issue in the editor. I also was able to reproduce similar problematic results with just a Scene Capture 2D component in place of the whole actor class in the project here. I suspect I’m missing some setting or step that is causing the memory leak in the Scene Capture 2D, OR the change that I needed to make to have the spectator class work with my HMD (*Is Head Mounted Display Connected *vs Is Head Mounted Display Enabled) is suggesting another issue.

Any advice on the apparent memory leak when using Scene Capture 2D would be extremely helpful!

[Edit: I am using an Oculus Quest with a link cable]

@Kevin_Bluecadet Could you try the following? In Engine.ini, add this:


[/Script/Engine.RendererSettings]
r.SceneRenderTargetResizeMethod=2
r.SceneRenderTargetResizeMethodForceOverride=True

@VictorLerp Thanks! I’ll have to test a little more thoroughly, but off the bat that seems to have done the trick. Sorry if I missed that mentioned somewhere

@Kevin_Bluecadet The Engine.ini addition is for engine versions released after the livestream and project was produced. Let me know if that indeed fixed it and I will add a note to the documentation for others!

@VictorLerp just to clarify, are Engine.ini and DefaultEngine.ini the same thing (I’m relatively new to Unreal)? I made the change in DefaultEngine.ini - Tested with both an Oculus Quest with a link cable and with a Dell WMR headset, and that seems to have done the trick. Thanks for the fix!

Hi!

I know … nearly 2 years late for that, but are the project files still available somewhere else? I’d like to understand how to set up the Menu widget with interactions (as mentioned in the livestream > translate the mouse click to the 3D world)

Sorry for interrupting the slumber.

Great stream btw! Learned a lot.

Thanks for letting me know! I’m not sure what happened to the previous link, it’s just dead now. You can find the project files here though (and the OP is updated with the correct link).

Awesome. :eek: Thank you!

Revived for updated link…?
“Oops! That page doesn’t exist or is private.”

We’re working on resolving all of the links that aren’t working after the Forum migration - but in the meantime, here’s a direct link. You can find all of the available projects from our livestreams in the Asset-Sharing section of the forum (Forum log-in required).

Hey I’m getting the same error for accessing the project files as everyone else, is there any way I could get a direct link?

Did you try to access them after you logged in? You have to be logged in before you can access the link.