Download

[Gear VR] 3D widget doesn't render correctly (cross post from Answer Hub)

https://answers.unrealengine.com/questions/412076/gear-vr-3d-widget-doesnt-render-correctly.html

3D widget doesn’t render correctly in Gear VR

Oculus thinks it’s a bug in UE4

Apparently it is a bug - parenting it to camera’s anchor puts it in the center (more or less), but it no longer follows camera. Details are in the AsnwerHub’s post.

Dear Epic, is this going to be looked at and fixed for 4.12 ?

Note that it would be nice to be able to disable depth sorting on 3D widget. This way I’d just place it outside the character and align it to the camera.

This is a known issue and on the answerhub here: Disable depth testing for 3D UMG widget - UE4 AnswerHub
(reported by the escape velocity guys: https://www.unrealengine.com/blog/creating-escape-velocity-for-samsung-gear-vr )

Would be awesome if it was included in ue4 stock - but at least there is a workaround there for anyone willing to compile from source

Something new in 4.12 that might be another solution is:

"Improved Stereo Layers Support - Layer support now works on all platforms, and has been improved to be more user friendly"
from release notes here: https://forums.unrealengine.com/showthread.php?108495-Unreal-Engine-4-12-Preview

This is still undocumented and I’ve not had time to try to work it out yet but sounds promising …

Hopefully they will fix it. Epic said they can’t reproduce the bug, but I provided them with my project, so hopefully they can see what’s up.

Another issue is disabling depth testing on not only opaques but also on 3D widget specifically, as even if I make it transparent, there is no option to disable depth sorting on it.

Oddly enough, either I didn’t explain it correctly on AnswerHub, or they aren’t testing it on the device (or they do but on S7 and not on S6), or something else, but apparently there is no such issue on their side :confused:

Can someone with the same issue chime in at AnswerHub please ?

Soo, any luck with this bug https://answers.unrealengine.com/questions/412076/gear-vr-3d-widget-doesnt-render-correctly.html ?

You dont need to make a new material and set code… just go into the engine materials and find the Widget3DpassThrough Material, (the one they’re talking about) the main one and then set to transparent and then Disable Depth Test on it. This will not affect anything you do in 2D or even in 3D-VR if placed in world (ie -overlap and seen through - it will not until… and only from your camera on your character)

— You add a Widget in you character and attach your HUD Widget or what ever widget to this in the Widget Class option. Place this widget outside your capsule now, 1 meter - 2 meters hell do 20.

Then go into the details on this new widget on character you made, go down to Render Custom Depth pass, enable. And then set Translucency Sort Priority… (your call) 1000 close - 0 distant

now like they mentioned on the other thread, you will see on PC no more clipping on widget when overlapping objects. But they will Pop in and out of view if your still. You now know this will work in GearVR. test now and you will see the depth has been disabled on your widgets.

hope my crappy written how to helps ya’ll works for me.

OH and to add… If you update the engine to a new version… IE 4.11.1 to 4.11.2 you need to redo the diable depth test with that Widget3d material or your huds on character will clip again and not do what ya want in GearVR…

I almost lost my mind the other day because of this. so take note if you do this.

also try testing the widget in a BP and setting it out in map against a wall and over lap into the ground, you will see the depth disable on main material only kicks in from your camera on your widget when you enable its depth and set distance.

Ok done, more coffee. :slight_smile:

Big thanks to Alexander Paschall for putting up with my senility and drama on this.

To add… the earlier link from up top https://www.unrealengine.com/blog/creating-escape-velocity-for-samsung-gear-vr the post process box for character fade in works flawlessly in GearVR BTW.

I am using Masked material for view fade effect (because there is no way to do it with Translucent material). Note that additive material is less performance taxing than translucent.

However, there is no way disable depth test with Masked material.

Render Custom Depth doesn’t work on mobile, so I don’t know where you got that idea from.

“They” also said that setting Widget’s engine material will affect all widgets. Not to mention it’s not possible to apply any material to Widget’s text.

Fade effect on post Process box the way they said Works. it uses translucent setting in material. I have not tested overall performance between masked or translucnet, so I’ve no comment on that. but i use translucent.

And, Ok man if you don’t wanna try and see that it works, it’s ok with me because it does on my side. I’d try it first… do a build out and test on gearvr. Why take a THEY SAID NO word over a try this and see word. Ya might be surprised.

Disabling Depth Test on Engine Material yah will affect across board no doubt. But what I’ve experienced is it wont have any effect unless its in a widget in character chosen under widget class, then set there in that widget below the depth and sort. any thing out in world using same base is not turned on. And it works with what ever you put on main widget text sliders etc…

a widget in BP set into world with no depth set is just primed by setting main material. It will stay put… no depth overriding.

I’ll post pics saturday night of a test level, with PC comparison and hopefully by then I can figure out to screengrab off android in dev mode… if not crappy iphone pic of android in dev mode.

Or better yet… lemme get your osig file and ill send ya scene to test.

So how do I make sure my 3D widget uses that material?

Also, what to do when making scratch project? Would I simply migrate engine materials to my scratch project ?

EDIT: Alright, in PIE it only works (or rather sometimes it does, sometimes it doesn’t) if 3D Widget’s blend mode set to transparent. If it’s masked or opaque, depth test still happens and 3D widget gets occluded by other actors and level geometry.

Btw, this doesn’t solve the issue of 3D Widget not rendering correctly in VR if it’s a component of player’s character.

If set all Widgets work off that material it seems as a pallette.

if you set engine widget3dpassthrough material depth disable test checked… all projects widgets pull from this main material… no need to do anything for new projects.

RIGHT in PIE if if pops in and out and not clipping then it will work in GearVR

ok in character bp. you add a widget from drop down, name it, then in its details panel you then choose your desired widget that holds HUD stuff…
and in this widget you added and named down in its details is where you set depth properties… attach to camera if HUD and drag out past charcter bp collision about 120cm to 300cm, also you can set its trans-mask-opaque here too. I’ve seem no difference. pops not clips in PIE means works in GearVR on my side.

That’s what I am doing. Except that with widget component set to Masked (component that parented to camera in Player Character and where I choose HUD widget in), it doesn’t work. Only when set to transparent it works (draws on top of the scene).

There is really no need to read between the lines - screenshots explain it all in my bug report on AnswerHub. If 3D widget is parented to Camera it doesn’t render correctly in Gear VR. If I have it outside player character as an actor and track location/rotation to player’s, then it works fine. It’s engine’s bug and unfortunately Epic doesn’t seem to be aware of it (or they are, but it’s not a priority fix).

So in 4.12 you don’t have the same issue I do with 3D widget not rendering properly in VR ? (nothing to do with depth test; just broken stereo rendering)

If I don’t parent 3D widget to the camera (as a component in the player character), it renders fine in VR (but then I’d have to track it to view using BP)

I am on 4.11.2 and I use Gear VR, which doesn’t have stereo instancing nor stereo layers. I am working off FPS Template.

Nope. If I use static mesh, it renders fine. That’s why I was contemplating dropping the idea of using 3D widget and use mesh instead (not going to be as flexible and wouldn’t allow for actual HUD functionality).

Tim replied on AnswerHub, but it didn’t sound like he was able to replicate the issue, which I find odd, since it is the issue everyone else is having on Gear VR. I guess maybe he is investigating deeper. We’ll see if I hear from him next week.

Yeh :slight_smile: I used to live in Austin.

till I have one problem with Gear VR and 3D widget - he doesn’t properly auto redrawn, after each action with UMG info I need to use “Request Redraw” function