Forum Discussion
motorsep
9 years agoMember
[Gear VR] Rendering UMG widget in StereoLayer component - how? (BP only)
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
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
Replies have been turned off for this discussion
- rpalandriExpert ProtegeHey!
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! - motorsepMember
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. - rpalandriExpert Protegeok!
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 :) - motorsepMember
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) - rpalandriExpert ProtegeI 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.
- motorsepMember
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 ? - rpalandriExpert ProtegeThe 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). - rpalandriExpert ProtegeFor 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
- motorsepMemberI 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 ? - rpalandriExpert ProtegeStereoLayer is most definitively a way better option to clarify the text, it's 100% the right tool to use. It does need a texture as input though, and the current best way (I think) to render a UMG to a texture is the 3D widget. Then, instead of rendering the 3D widget into the world as they do in the tutorial, use the generated texture as input for your StereoLayer.
I should do a sample of that.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 2 years ago
- 7 months ago