Is there a good way to make a stereo HUD for the Oculus Rift yet? My current workaround involves placing/sizing static meshes and text actors in front of the player’s camera, but the components’ locations don’t update fast enough when the player looks around (aka HUD lag).
Ok, so I found a better solution than what I was using earlier so I will answer my own question (kinda) for others who are curious. This also works for people using the VR Template from the wiki.
–To make a good no lag crosshair–
Step 1 - Crosshair Blueprint: Create an actor blueprint. Add component “scene” and call it dummy. Add component “static mesh” or “billboard” (if its a texture) and call it something like “Crosshair”. Apply material, make visible, change transform, etc. Nothing is needed in construction or event graph.
Step 2 - Blueprint Integration: You have a choice now; you can implement the hud in your character blueprint, or a separate MyHUD blueprint (don’t forget to select the MyHUD bp in the game mode bp if you do). Now all you have to do is spawn the Crosshair blueprint with the “Begin Play” event node based on the “Get Player Camera Manager” node’s transform (but you add a forward vector offset so its in front of the camera), and then attach the Crosshair BP spawn to the camera manager. I have included a picture below of the implementation.
Edit: You will have to alter the distance from camera and Z axis vector offset depending on your HMD offset. Where as I used 40 in the distance multiplier and 0 for the Z axis offset for normal first person, I had to use 80 and 13 to adjust the hud for the HMD settings I had. If you still don’t see your HUD components, make sure they are big enough, far enough away from the camera, and rotated correctly.
EDIT: Added Dynamic Crosshair Example for those interested in VR, or have clipping issues (see image below). Due to the image size cap, I cannot include the in-game appearance screenshot. See one of my comments below for the in-game result.
This is partly working for me: the positional tracking offset with DK2 isn’t being applied. I still have to set hud actor position on tick (which causes lag).
We are working on a solution for this using UMG, but there are currently bugs with the stereo rendering that we are working through. Once we have this up and running properly, we will announce it in a patch note.
I use the same approach, but say if I’m in front of a wall, and the crosshair is rendered like 2-5 meters in front of me, it will be hidden, right? Any solution to this?
Thank you for your information and time. I see that you have indeed come up with and answer to your own question. However, I thought I would share an example of how someone who might want to use UMG might achieve a similar effect. I have had success with setting up my UMG as I would normally and then creating a master widget that using the original widget via the “User created” section of the Palette panel. I hope this helps.
Please make sure to anchor your widgets correctly. For example My minimap is anchored to the bottom right corner of the screen. This will allow for easier adjustments in the next step.
All I did for this step was divide the screen in half and place the “VR widget” twice. This is the one that will be added to the screen. Note: By default half of the x axis is 960 (1920/2).
Sorry for the long radio silence, I returned to school and was busy with EE stuff. Now that I’m back at work, I have some time to comment. A rough solution to your problem n4rco would be to add a small invisible hit box to your hud, but this could cause weird problems later (like a player getting snagged by a tree). A better solution would be following the staff members suggestion :).
Also, I found that this form of crosshair was actually bad for use in the oculus rift. By creating a crosshair that floats in front of you, it essentially had the effect of “dirt on glasses.” It was uncomfortable to use, because your eyes will want to focus on the crosshair and the faraway target. In the end I changed my design and made a crosshair that resembled more of a laser pointer.
Hi , thanks but your idea with the collision box won’t really work for me, because my game is based a lot on collision.
But hey, maybe I have found out a way to actual implement your method without your HUD overlapping with other actors.
Which is (I guess) the better method, because you don’t draw the same image on both lenses, what can cause motion sickness(see here(Convergence): http://media.steampowered.com/apps/valve/2013/Team_Fortress_in_VR_GDC.pdf)
Set Disable depth test: Keeps the material in the foreground.
Settings I did in postprocess volume(placed around material billboard):
Postprocess volume setting: AA Method: none
Set motion blur values to zero.
It was uncomfortable to use, because your eyes will want to focus on the crosshair and the faraway target
It could also be combined with line traces, to search for the nearest actor to place your crosshair/hud, so you could bypass this disparity. Not my idea, also stolen from valve
This thread is amazing, I’ve been trying to solve the same problem for days now. I was trying to use some geometry for a lot of the UI to beat the stereo issues, but was getting caught up attaching it to the camera.
Does anyone know of a good way to create some lag in those HUD elements. A bit like the first person Metroid games utilized. I feel like this could help break the stuck to your face effect these elements often have.
It’s also a shape that Materials need to be set to Translucent to utilize the Disable depth test check box. I really would like to use it some masked materials.
I feel that for tracking purposes the question that you have posted is different enough to warrant another post on the AnswerHub. If you could make a new post and link it in a reply on this thread, I would be more than happy to assist you further.
Ha, you and I are on the same wavelength about the crosshair. When I say a laser pointer type setup, I meant I use a raycast that “on impact” sets the location of the crosshair, but with scripting that shortens the distance so that it does not clip into any meshes and it has a set distance so that u don’t move the crosshair a mile away on accident (crosshair is no use if you can’t see it).
For those who are curious, the example below just draws a dot for a crosshair, but it’s easy on the eyes in VR. You could swap out the debug point for something else if you wanted.
Yes, this method still works. You will need two separate Widget blueprints. One widget blueprint will have the widget that you would like displayed and the other widget will hold two separate copies of the first.
As you can see in the pictures above I have created a widget blueprint that holds a button, a health bar and a minimap. After that I created another widget blueprint (the one that is seen in the second image) that holds two copies of the first blueprint. When the second blueprint is set up you will then add the second blueprint to the screen. I hope that this information helps.
I was able to get this solution working in 4.10.1 with a caveat; the HP bar and some other elements I placed are blurry. I’m guessing my problem is that I’m not anchoring some things properly.
In my Master Widget, I am anchoring the left panel to the upper left corner as shown and I’m anchoring the right panel to the upper right corner.
Is this correct?
Would you please share the anchor settings for the widgets you placed?
Hello, I wanted to ask information, The crosshair works perfectly. But finding problems when quickly move the view, and it go out of alignment. There is a solution to this problem?
we’re trying to get this to work on 4.17.1 right now, but we are having difficulties.
Is this method supposed to still work? We’re strictly following your pictures and text, but the result never shows one solid HUD on the HMD, but always cluttered elements of our HUD split on left and right screen views.
Any idea if we overlooked something or if it simply doesn’t work anymore? And if it’s the latter… is there an alternate method now?