x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Oculus Rift HUD Solution?

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).

Thanks, Fenra

Product Version: Not Selected
Tags:
more ▼

asked Jul 01 '14 at 04:33 PM in VR

avatar image

Fenra
276 9 15 185

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

Hope this is useful for someone,

Fenra

alt text

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.

alt text

blueprintpic.png (155.8 kB)
more ▼

answered Jul 03 '14 at 05:21 PM

avatar image

Fenra
276 9 15 185

avatar image Cynistyr Jul 05 '14 at 08:12 PM

I love you for posting this.. Saved me so much time

avatar image num3ric Oct 22 '14 at 05:54 PM

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).

avatar image Alexander Paschall ♦♦ STAFF Oct 22 '14 at 06:03 PM

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.

avatar image n4rc0 Dec 15 '14 at 01:52 AM

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?

avatar image Rudy Q ♦♦ STAFF Dec 15 '14 at 04:01 PM

Hello Fenra,

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.

VRwidget

alt text

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).

MasterWidget

alt text

Make it a great day

vrwidget.png (22.7 kB)
masterwidget.png (34.5 kB)
avatar image Roonan Jul 24 '15 at 06:06 PM

Hi

Is this solution still working? I Try this but doesn't work. Could you explain precisely how you proceed?

thanks

avatar image Rudy Q ♦♦ STAFF Jul 27 '15 at 03:03 PM

Hello Roonan,

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.

Make it a great day

avatar image haruna Jan 05 '16 at 03:29 AM

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?

Thank you very much.

avatar image Rudy Q ♦♦ STAFF Jan 05 '16 at 02:00 PM

Hello haruna,

Both of my widgets are anchored to the top left.

avatar image D_Petrov88 Nov 10 '17 at 01:21 PM

Hi Rudy,

I also want to know a way to properly display widget hud into Vive HMD. I've tried the method you describe but seems it don't work properly in 4.18.0.

Regards!

avatar image Calisto Sep 19 '17 at 04:20 PM

Hi Rudy,

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?

avatar image Rsalagre43 Sep 28 '16 at 05:50 AM

Hey Rudy, I am bit confused that which widget(VR widget or Master Widget) should i add to the viewport?

avatar image Fenra Dec 16 '14 at 06:53 PM

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.

avatar image n4rc0 Dec 18 '14 at 04:09 PM

Hi Fenra, 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)

alt text Settings I did in material:

  • Blend mode: Translucent.

  • Shading model: Unlit

  • Set Responsive AA: Gets rid of micro jitter.

  • 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 ;)

s3.png (221.4 kB)
avatar image Fenra Jan 08 '15 at 06:27 PM

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 max set distance so that u don't move the crosshair a mile away on accident :P (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.

[Deleted image here and moved to my first post]

Figure 1: Blueprint

alt text Figure 2: Example of Crosshair changing distance based on raycast.

avatar image pixelvspixel Dec 29 '14 at 08:27 AM

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.

avatar image Rudy Q ♦♦ STAFF Dec 31 '14 at 07:18 PM

Hello pixelvspixel,

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.

Make it a great day

avatar image diegozazza88 Mar 24 '17 at 09:54 AM

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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question