[Solved] NiftyGUI and OpenVR?

Sorry if this is a worthless post, but has anyone tried using the NiftyGUI and the vr plugin together? My searches didn’t come up with much, and the common find was just quieting the logger for nifty.
This is just me dipping my toes into VR in the interest of forward-compatibility. I could be outdated too, I think I had a master-copy of 3.3 that I was trying.

The added text on the GUI node works in my testing, so that at least gets handled correctly. And earlier I had to add the VRAppState first before the rest of my game (otherwise it only loaded in one eye, but the HUD was in both eyes).
The Nifty GUI, however, doesn’t show up.
I did try adding it as a processor to a viewport for the left/right eye, but something was null. I could just be applying it at the wrong time.
The solution I haven’t tried yet is applying it to an object as a texture and then trying to glue it to the GUINode. Mouse probably wouldn’t work but the rest should be navigable.

I’ll update this later tonight when I get a chance to try my other solutions. Otherwise, my interfaces are young enough where I could jump ship to a different GUI method. This is again, in the interest of forward-compatibility, since it could be pretty cool. (I got my Morrowind loader plugin to work with this already and it was pretty nice).

Does niftygui allow creating 3d UI elements (i.e. a window floating in the 3D world attached to the root node, not on the gui node, flat against the screen). For VR it would have to be 3d GUI.

To answer a slightly different question; Lemur based GUIs works very well coupled with VR as it supports 3d GUIs. Are you using Tamarin for VR? If so Tamarin has a bunch of stuff to help interact with 3d Lemur GUI elements using your hands, see MenuExampleState as an example

[Conflict of interests warning; I’m the author of Tamarin]

P.s. im not sure i understand what you mean by “Mouse probably wouldn’t work”, in VR you wouldn’t have a mouse

From the documentation I saw, the niftygui can be applied as a texture for an object in the world. So I could interact with text fields or something.
Since I pass the Nifty instance down to the other parts of the game, it would just be a matter of applying it to a 3d object before the game proper starts and handling it as a “slate” or “screen” and the rest should work normally.

I haven’t used Tamarin or Lemur (yet) but I’ve got that as a possibility to jump over to.
Regarding the “mouse”, my projects are mostly keyboard + mouse first-person but the menus were with a free mouse. The little I read about putting Nifty on an object was that a mouse wouldn’t work anyway, so there’s that. I’d probably just plan things around making them control-navigational.

Just a note in case it wasn’t clear… when people say that Lemur can do 3D UIs they mean that buttons and controls, etc. can float in 3D space, fully 3D. This is not the same as just projecting a 2D UI onto a plane in 3D space (which Lemur can also do).

So while “2D UI on a plane” may work for your use-case, I just wanted to be clear that this is not what folks mean when they say Lemur can do 3D UIs.

Oh cool. I did manage to (poorly) test a scenario where I got the Nifty GUI (2d on a plane) onto an inworld cube, but initialized it as if it was still on-screen. With that I was still able to click on things because it believed it was still an on-screen GUI that just happened to be projected in-world.

I haven’t gotten it to be on the guiNode (only just tried now) but failing that, I could use the final observer values from VRAppState to orient the menu in front of the user’s face and simulate a cursor.

Neat about the Lemur UI making individual buttons and controls just floating in the air, and I’ll look into that later.
I guess I can call it solved:
“If you apply it to an in-world object and pull some trickery, then yes”. But there are better ways to do it.

Last follow up (Because I can’t let well enough alone).
Yes you can apply the object to the GUI, I just didn’t scale it right so I wasn’t seeing it or it was behind something else (like the FPS meter).
So… a little less trickery. (I’ll update this with details later).

  1. Initialize the Nifty like normal. (so it will take direction from the mouse if you’re still using one).
  2. Apply it to an object.
  3. Attach the object to the guiNode. (Remember to scale and position it right).
  4. Party down.
1 Like