我从 hellovr_opengl 获取代码并会渲染 2D 帧。
在 openvr sdk 中,您应该在调用提交函数之前渲染。
我正在做的是生成纹理 m_itxture 然后在循环中我将 rdb 数据链接到 m_itexture。这是我的 renderFrame 的样子:
RenderStereoTargets();
//RenderCompanionWindow();
vr::Texture_t rightEyeTexture = { (void*)(uintptr_t)rightEyeDesc.m_nResolveTextureId, vr::TextureType_OpenGL, vr::ColorSpace_Gamma };
vr::VRCompositor()->Submit(vr::Eye_Right, &rightEyeTexture, NULL, vr::Submit_Default);
//leftEyeDesc.m_nResolveTextureId = m_iTexture;
vr::Texture_t leftEyeTexture = { (void*)(uintptr_t)leftEyeDesc.m_nResolveTextureId, vr::TextureType_OpenGL, vr::ColorSpace_Gamma };
vr::VRCompositor()->Submit(vr::Eye_Left, &leftEyeTexture, NULL, vr::Submit_Default);
但我不知道如何在 RenderStereoTargets() 方法中将 m_itexture 链接到 leftEyeDesc.m_nResolveTextureId
有什么帮助吗?