Jump to content

[UE4][VIVE][VR]The bug StereoLayer UI show layer error by Unreal Engine 4.26 c++


Recommended Posts

I have a bug only on vive pro(pro2).
Bug desc: I show a UI in VR and I want to touch UI menu by hand StaticMash. But In VR Devices(vive Pro/Pro2) the UI show on Topest Layer always.  the Pc show window is OK, VR View the UI layer is Top.
I show UI is use the code :
-----update ui in Tick() ------

UTextureRenderTarget2D* rt = WidgetPtr->GetRenderTarget()


Tool: Unreal Engine 4.26 C++.
device: Vive Pro \ Vive Pro2
===============more info by Chinese============== 
       我们遇到一个htc VR头显上的特有问题.我们项目想使用手来点击UI进行操作,我的UI使用StereoLayer来呈现更清晰的UI显示, 但在运行中VR头显中显示的画面,UI使用遮住了手部模型(但此时PC端画面显示正常)
使用设备HTC VIVE PRO2(vive pro等都有同样问题). 同样的程序在其他品牌头显中显示正常(Oculus Rift S等)
(截图中左上角是我们在VR头显中看到的不正常的画面, UI始终遮住了我们要去点击它的手部模型)
开发软件Unreal Engine 4.26 C++代码开发
这个现象我们在Oculus Rift s等其他PC VR头显上没有遇到.请问这个问题是有什么特殊设置吗?还是说需要特定代码来实现.
UTextureRenderTarget2D* rt = WidgetPtr->GetRenderTarget()
void UDynCalUiManager::Tick(float DeltaTime) {
   //widget的内容填入到stereoLayer   for (int i = 0; i < widgetStereoLayerPairArr.Num(); i++) {
      WidgetStereoLayerPair* pair = &widgetStereoLayerPairArr[i];
      UTextureRenderTarget2D* rt = pair->WidgetPtr->GetRenderTarget();
      if (rt->IsValidLowLevel()) {

void UDynCalUiManager::AddWidgetStereoLayerPair(UWidgetComponent* widget, UStereoLayerComponent* stereoLayer) {
   WidgetStereoLayerPair pair;
   pair.WidgetPtr = widget;
   pair.StereoLayerPtr = stereoLayer;

This bug is only On HTC vive Pro/Pro2 ,the Oculus Rift S no this bug.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...