in VR mode,how to let PC show 1920*1080 single screen

Hey CompilingShaders,
I don’t know if I’ll have the time to setup a Blueprint project for you, but I can help you troubleshoot your issue. I implemented it in my own plugin so it’s in c++, I don’t know if that can help you. A lot of things could cause the pawn not to track. Could you give me more information as what is not working? Are you able to connect to a network game? Are you sure the headset’s transform data is replicating correctly? Make sure you are spawning the spectator pawn from the server, not from a client, it won’t replicate correctly otherwise.

For your stereoscopic camera issue, I haven’t heard of an easy solution, but if you are using a custom pawn with my solution, you could set it up with 2 cameras and use render targets to simulate a stereoscopic view.

Yeah it seems to me it’s a replication problem. For this solution to work, anything the user do has to be replicated, so if you have not used replication in UE4 before it might get complicated. However, if all you do in your app is move the pawn and the headset around, it’s not that bad. Look up variable replication, it is very easy to replicate variables in UE4. You need to replicate the world transform
and the local camera transform of the player pawn. Once you have those variables replicating properly use those values to update the specator world transform and its local camera transform every tick. I think you have the rest working properly.

Also for your stereo camera issue. I think emulatestereo is indeed what you want. To enable it, package your project, and launch it with the argument -emulatestereo
On windows, you do it by creating a shortcut to your executable and editing the target like so:

Hey Sigfreud, thanks so much for your quick response. I tried various ways to implement the mirroring. I have a main character in the level which auto possesses player0. I then have another Pawn which is already in the level, and in the level blueprint I have Press Letter K event to grab player 1 controller and posses the Mirror pawn. In the main character blueprint I am grabbing the camera location and putting it into a veriable which is then referenced in the mirror pawn and setting the location of its camera. Because of the way oculus works with UE4 I place the camera on the floor and the blueprint calls to offset the height to the eye level set in the oculus configuration. I was thinking this might be affecting the location, so I started experimenting with using the get rotation and orientation (I think?) node which is in the HMD section. I was printing to the screen the location and rotation so I could debug. I tried using world pos/rot, reletive pos/rot, transforms, etc, and most of the time it either sticks my character at 0,0,0 or I am placed exactly where the character is placed in the level before the level starts (on the floor 216). I had a few moments where it was working when launching it from the editor, but when I join the game in a packaged version it only seems to be updating on the client when I move the mouse on the server, but not when the HMD changes the camera’s Pos. Thanks for all of your help, I am installing this work in an art gallery in a few days and I thought I was completely out of hope. The main goal is to get a FullHD 3d rendering on a large TV monitor mirroring the headset.

Thanks for the suggestion about the 2d scene capture, I actually did that earlier and then applied the textures to a widget. It seems to sort of work, but its a bit janky. I wish there was a way to call the --emultestereo from within the engine.

Cheers

Also, I think that it’s worth mentioning, I just found out about replication, and I haven’t ticked the replication options for any of the variables which I am attempting to send over to the client, so that very well could be contributing to the issue. However, why would the mouse Rot seem to send over just fine?

I started over, and now I have an issue where everything seems to be transferring over to the mirror pawn, however, the Y axis on rotation seems stuck. This has continued to be ever so frustrating. I’m really looking forward to knowing all of these functions inside and out. Any idea why this up and down rotation isn’t working? I have also looked into this very simple node called set view target with blend. It seems to simply force the view of one player to another. I implemented it into my main controlling player, so once other players have connected to the game, using a get all actors of class, I simply hit the letter T on the keyboard of the server, all of the connected players switch view to what the server is seeing. It seems to do the job, but again the Y axis is stuck. :frowning:

Alright, I wouldn’t use set view target with blend, it’s meant to be used with static cameras. I put together a sample project with a basic implementation, you can download it here: VRSpectator_SampleProject.zip - Google Drive
Without looking at your whole project, it’s hard to tell what’s wrong, but I hope this can give you a baseline.

Sigfreud, thank you so much man! You are a life saver. I migrated your pawns, GM, player controller, etc. over to my map and tried it out in the editor. Everything looked it was running fine, however, when I packaged the project and tried to run it stand alone, the client user connects to the server and gets put at 0,0,0 for a split second, then get put at the player start location without any movement controls. I am simply packaging the project, creating a shortcut called projectname.exe --VR, launching that one, opening the console and typing open ?listen, opening a regular instance without the --VR, open console type open 127.0.0.1. Do you have any idea what I might be doing wrong, or why it seems to be working perfect in the editor but not in the package? Also from what I saw in your blueprints, you have press T to become spectator? Does that mean any joining player will get added as a HMDmirroring camera, and if they press T they will then be able to fly around the level? Thanks again so much for your help. You saved my degree show :slight_smile:

Sigfreud, to help you better understand what’s going on, I tried to package your level and play it the same way. Here is a video of me trying to launch your level and then launch a spectator instance. Pressing T doesn’t seem to help https://drive.google.com/file/d/0B1HrKnJyn2SPaVBXeVJzbExMeWc/view?usp=sharing

Glad I could help. It might be that you are not setting maps and modes correctly. Look at the packaging settings in my sample project and make sure you are setting the correct game mode for each maps you are using. The spectator pawn doesn’t have any controls attached to it, it will only track a set pawn. When they first join the game they will possess a VR pawn but by pressing T they possess a spectator pawn, disable stereo rendering and destroy their old pawn.

Also, you probably have your movement controls written in your own PlayerController class, make sure you are using your controller and add my code to it. The only class you are probably going to use from my sample project without any modification is the Specator class.

Ok, it’s hard for me to tell when you are pressing T, but it should be on the listening server, I think you might be doing it from the connected client. Also to make sure that your client connected to the server, you can open the full console by pressing ~ twice, and when the client connects, you should see it’s name showing up in the console.

First make sure that you are actually connecting to the server, then make sure that you are pressing T on the server window, after the client has connected.

Also, from my own experience, doing this on the same machine doesn’t work half the time. It seems you are using a Rift headset but with a Vive, you can’t open two VR application at a time. So if you can, try to use a different computer connected to the same network.

I think I figured it out. I stopped using the --vr flag, because I guess it’s not really necessary, and then I realised that I need to press T on the server and then the client is now controlling the VR Character and the server is doing the non stereo mirror. Why does “T” not seem to work on the client side? I would have thought that the actual computer that the VR headset is connected to would be the server. Thanks again!

Only the authoritative version of the controller can possess a new pawn, so it has to happen on the server. You can do it from the client but then you would have to use a RPC to the server.

Hey Sigfrued, Everything worked fantastic. However, I am now running into a problem when trying to switch levels. I am running level streaming. There is one blank persistent level, and 3 other normal levels living under that. I start in Level 1 and the user presses a button to move around the space. Eventually when they have made it to the end of all of the different locations they teleport to, it will switch to the next level. I was doing this using the Load level stream function and unloading the previous level. I even managed to get this running with the HMD mirroring setup that you helped me with. However, when the level updates on the HMD, the spectator continues to see level 1. I believe this is because I need to run the “load stream level” from the server instead of the client. I tried various ways of making the server catch a changing variable on my pawn with a tick and then react to that by executing the load stream level, however, I can’t manage to control the server from the client. Is there any way to setup your spectator setup where the server is the computer running the headset, or do you know of any ways to execute a Load level stream from the client and have it also happen on the server? Thanks for all of the help.

Instead of opening a new level to switch levels, try running “ServerTravel” instead from the server. If it is triggered by the client, you might need to make a server RPC from the client to have the server travel to another level. The difference between opening a level and a server travel is that all connected clients and the listening server will load the map and re-connect to the same map. I am not sure with the current setup if the spectator pawn will continue tracking the player pawn after the travel, you might need to press the T key again after the map is loaded.

can i use these two codes in a execute console command node in event begin play?
r.setres 1080x720
HMD mirror 2
(one command per node)
howelse can i use them?