Rerd Posted November 1, 2022 Share Posted November 1, 2022 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() StereoLayerPtr->SetTexture(rt); (In screenshot, the Main is pc screen . LeftTop is the error in the VR Devices,the UI on the top of hand.) Tool: Unreal Engine 4.26 C++. device: Vive Pro \ Vive Pro2 This bug is only On HTC vive Pro/Pro2 ,the Oculus Rift S havn't this bug. ===============more info by Chinese============== 我们遇到一个htc VR头显上的特有问题.我们项目想使用手来点击UI进行操作,我的UI使用StereoLayer来呈现更清晰的UI显示, 但在运行中VR头显中显示的画面,UI使用遮住了手部模型(但此时PC端画面显示正常) 使用设备HTC VIVE PRO2(vive pro等都有同样问题). 同样的程序在其他品牌头显中显示正常(Oculus Rift S等) 现象如下图: (截图中左上角是我们在VR头显中看到的不正常的画面, UI始终遮住了我们要去点击它的手部模型) 这是VR端中看到错误显示的截图(通过SteamVR的"显示VR视图"功能截图),手部始终被UI显示挡住 开发软件Unreal Engine 4.26 C++代码开发 这个现象我们在Oculus Rift s等其他PC VR头显上没有遇到.请问这个问题是有什么特殊设置吗?还是说需要特定代码来实现. 我们实现代码如下: 为了呈现清晰的UI,我们在每次更新中(Tick),将UWidgetComponent的内容复制给UStereoLayerComponent来呈现 UTextureRenderTarget2D* rt = WidgetPtr->GetRenderTarget() StereoLayerPtr->SetTexture(rt); ====================== 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()) { pair->StereoLayerPtr->SetTexture(rt); } } } //添加Widget与StereoLayer配对 void UDynCalUiManager::AddWidgetStereoLayerPair(UWidgetComponent* widget, UStereoLayerComponent* stereoLayer) { WidgetStereoLayerPair pair; pair.WidgetPtr = widget; pair.StereoLayerPtr = stereoLayer; widgetStereoLayerPairArr.Add(pair); } ====================== 请问,这个问题如何解决呢? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now