ovrLayerEyeFovDepth in 1.20 SDK for positional timewarp
Hi everyone,
we've just upgraded our Oculus implementation in Enscape for the latest windows SDK release v1.20 which should feature depth buffer support for positional timewarp according to the release notes.
We therefore create an additional depth texture swap chain:
And render to it:
We set up the layer description for ovrLayerType_eyeFovDepth:
And can successfully submit that frame:
Is there anything else we're missing to enable positional timewarp (in a GL application)? Sample implementations of the SDK are unfortunately a little sparse in that regard.
Thanks a lot in advance for any advice on that matter!
-Clemens
we've just upgraded our Oculus implementation in Enscape for the latest windows SDK release v1.20 which should feature depth buffer support for positional timewarp according to the release notes.
We therefore create an additional depth texture swap chain:
ovrTextureSwapChainDesc depthDesc = {};
depthDesc.Type = ovrTexture_2D;
depthDesc.ArraySize = 1;
depthDesc.Width = size.w;
depthDesc.Height = size.h;
depthDesc.MipLevels = 1;
depthDesc.Format = OVR_FORMAT_D24_UNORM_S8_UINT;
depthDesc.SampleCount = 1;
depthDesc.StaticImage = ovrFalse;
if(!OVR_SUCCESS(ovr_CreateTextureSwapChainGL(Session, &depthDesc, &DepthTextureChain)))
{And render to it:
GLuint curDepthTexId = 0;
if (DepthTextureChain)
{
int curIndex;
ovr_GetTextureSwapChainCurrentIndex(Session, DepthTextureChain, &curIndex);
ovr_GetTextureSwapChainBufferGL(Session, DepthTextureChain, curIndex, &curDepthTexId);
}
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fboId);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, curColorTexId, 0);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, curDepthTexId, 0);We set up the layer description for ovrLayerType_eyeFovDepth:
m_layerDescription.Header.Type = ovrLayerType_EyeFovDepth;
m_layerDescription.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft;
for (size_t eye = 0; eye < m_eyeSwapBuffers.size(); ++eye)
{
m_layerDescription.ColorTexture[eye] = m_eyeSwapBuffers[eye]->ColorTextureChain;
m_layerDescription.DepthTexture[eye] = m_eyeSwapBuffers[eye]->DepthTextureChain;
m_layerDescription.Viewport[eye] = OVR::Recti(m_eyeSwapBuffers[eye]->GetSize());
m_layerDescription.Fov[eye] = m_hmdDesc.DefaultEyeFov[eye];
m_layerDescription.RenderPose[eye] = m_eyeRenderPose[eye];
m_layerDescription.SensorSampleTime = m_sensorSampleTime;
}m_layerDescription.ProjectionDesc = ovrTimewarpProjectionDesc_FromProjection(proj, ovrProjection_ClipRangeOpenGL);And can successfully submit that frame:
ovrLayerHeader* layers = &m_layerDescription.Header;
ovrResult result = ovr_EndFrame(m_hmdSession, m_frameIndex, nullptr, &layers, 1);However there's absolutely no difference noticeable compared to not using the depth buffer at all, or when I messed around with the projection description to provoke reprojection artifacts. Upgrading the Oculus App to the latest Beta also didn't have any effect on that matter.Is there anything else we're missing to enable positional timewarp (in a GL application)? Sample implementations of the SDK are unfortunately a little sparse in that regard.
Thanks a lot in advance for any advice on that matter!
-Clemens
