RuntimeUnityEditor icon indicating copy to clipboard operation
RuntimeUnityEditor copied to clipboard

Does not work with VR Games

Open v0idp opened this issue 2 years ago • 14 comments

as the title says it does not support VR Games. no menu popping up. Plugin is loaded properly tho without errors.

v0idp avatar Mar 19 '22 17:03 v0idp

Check if it shows up on the desktop preview. The game needs to have IMGUI view enabled in some way for it to work, either as desktop-only or rendered to a camera. A lot of games are probably not going to have anything set up here.

ManlyMarco avatar Mar 19 '22 17:03 ManlyMarco

I did check the desktop preview. sadly no menu in there either

v0idp avatar Mar 19 '22 22:03 v0idp

Anyone found a solution? I do know the UnityExplorer plugin somehow, but works.

andrewpros avatar Jul 05 '22 15:07 andrewpros

UnityExplorer is visible because it uses a canvas for its interface instead of imgui.

ManlyMarco avatar Jul 05 '22 16:07 ManlyMarco

Hmm, im not into the internals that much, does that mean the plug-in OnGUI and Update needs to work? And some games will just not call OnGUI?

andrewpros avatar Jul 05 '22 17:07 andrewpros

The issue is that there is nothing to draw the UI to. I believe it's not possible to draw directly in the VR view, but it is possible to draw to the desktop preview camera and to a texture. I used the second way to enable plugins using OnGUI to be visible in VR on the desktop view tool in this mod https://github.com/IllusionMods/KKS_VR, but it relies on OpenXR which won't help here. I have some games that come with the first version working out of the box too, so it's definitely possible, I think it's a camera mask issue in this case.

ManlyMarco avatar Jul 05 '22 18:07 ManlyMarco

Well ok, i guess legacy unity GUI is outdated anyway, that why it wont work with vr and there not much to do about it.

andrewpros avatar Jul 06 '22 01:07 andrewpros

from my knowledge it is possible to draw imgui elements into VR. there is actually a fork of imgui for vr called imguivr or something which allows you to draw imgui overlays in all vr games. it uses openVR.

github: https://github.com/temcgraw/ImguiVR demo: https://www.youtube.com/watch?v=nlwfn4HJw5E

v0idp avatar Jul 06 '22 07:07 v0idp

Hmm, are we still talking about the same things and what it has to do with making RuntimeUnityEditor work in vr unity apps?

RuntimeUnityEditor is using unity IMGUI and this has nothing to do with c++ dear imgui.

IMGUI is basically the OnGUI event, at the same time IMGUI does not work with vr and it is kinda obsolete now so it will never in a official way.

But, maybe there is some hack to make it work or at least display on the desktop window without rewriting the whole thing...

Cuz i have heard that some vr games do display it still, but only on the desktop view, but im not sure how this is achieved.

But maybe some hacks are possible, like render the OnGui calls to a texture?

andrewpros avatar Jul 06 '22 14:07 andrewpros

maybe the texture thing might work, you could draw a plane/cube or whatever into the game and put imgui as a texture on it

v0idp avatar Jul 06 '22 15:07 v0idp

Its hard to find any info about it, no one cares really, and as it is legacy ui i wont look for it either, no point probably, it works in the vr app i tested, but op didn't specify what game it was, so i was curious.

andrewpros avatar Jul 06 '22 17:07 andrewpros

The Game was VirtuosoVR I believe.

v0idp avatar Jul 07 '22 09:07 v0idp

Works for me.

andrewpros avatar Jul 07 '22 10:07 andrewpros

welp then I forgot... sorry

v0idp avatar Jul 07 '22 13:07 v0idp