cancel
Showing results for 
Search instead for 
Did you mean: 

[Gear VR] Rendering UMG widget in StereoLayer component - how? (BP only)

motorsep
Rising Star
I am failing to display anything in StereoLayer component, not even a simple texture is being rendered. Ultimately I'd like to have UMG widget there so that I could put various messages in front of player when needed.

Is it even possible? Can someone please show me how ?

Thanks

P.S. I hope it's not more "expensive" than having conventional 3D widget in front of the camera
22 REPLIES 22

rpalandri
Expert Protege
Hey!
How are you setting up your StereoLayer component? Could you send us a screenshot of the parameters you're setting on it (transforms, world/head locked, and so on)
Thanks!

motorsep
Rising Star

rpalandri said:

Hey!
How are you setting up your StereoLayer component? Could you send us a screenshot of the parameters you're setting on it (transforms, world/head locked, and so on)
Thanks!



At work right now, but when I tried it, I simply added StereoLayer component to my player character, parented it to camera in the actor's viewport, moved it a bit away from the cam and chose a random image texture I had in my project (assigned it through component's details panel).

That's all I did and when I deployed to Gear VR, there was nothing in front of me in the game.

rpalandri
Expert Protege
ok!

StereoLayers have an inherent way to be locked to your player, or your camera, if you're interested. In the StereoLayer editor interface, you can choose between world locked (what it sounds like), head locked (will be locked to the camera ) and tracker locked (will move with the player, but keep its rotational position in space when the head moves). I would suggest trying to use that 🙂


motorsep
Rising Star

rpalandri said:

ok!

StereoLayers have an inherent way to be locked to your player, or your camera, if you're interested. In the StereoLayer editor interface, you can choose between world locked (what it sounds like), head locked (will be locked to the camera ) and tracker locked (will move with the player, but keep its rotational position in space when the head moves). I would suggest trying to use that 🙂





Right, I believe I used head locked option.

So, if what I described is the way to set StereoLayer component, why didn't it render image texture I assigned to it ? (and that's just a simple texture; I don't see how I can put UMG into StereoLayer)

rpalandri
Expert Protege
I would guess (that's why I asked to see your parameters) that the transform used wasn't correct. To be fair, it's not very intuitive. In head locked mode, the transform will be applied directly to the camera, so since OpenGL cameras look down the -Z axis, a correct transform would be something like (0, 0, -400), for a quad 4 meters away from the camera.

motorsep
Rising Star

rpalandri said:

I would guess (that's why I asked to see your parameters) that the transform used wasn't correct. To be fair, it's not very intuitive. In head locked mode, the transform will be applied directly to the camera, so since OpenGL cameras look down the -Z axis, a correct transform would be something like (0, 0, -400), for a quad 4 meters away from the camera.


So the easiest way to check if it works at all would be making some basic BP actor, adding StereoLayer component in and setting  tracker locked option ? 

This way I'd just drop it on the level and it should be rendered for sure as I "walk" around it, right ?

rpalandri
Expert Protege
The easiest way would be to get some actor, add StereoLayer in, and set World Locked option. When you click on the actor, after putting the stereo layer in, you should see a yellow outline showing you where the Stereo Layer will render, like in here: https://developer3.oculus.com/documentation/game-engines/latest/concepts/unreal-overlay


This outline is only correct for the World Locked option (as there is no way to see where the camera/tracker will be in the game, in the editor).

rpalandri
Expert Protege
For UMG, I haven't tried making it work, but you basically need to get UMG to render directly to a texture. This seems to be a possibility : https://docs.unrealengine.com/latest/INT/Engine/UMG/HowTo/Create3DWidgets 

motorsep
Rising Star
I was told that texture compression has to be "userinterface2d" and I didn't have that. Maybe that's why my StereoLayer wasn't rendering.

As for UMG 3DWidget, yeah, I already do that. I just figured StereoLayer is a better option for clarify of the text. Also, render to texture would be prohibitively expensive on Gear VR, wouldn't it be ?