mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-18 21:10:05 +00:00
render regular view on desktop in VR, instead of distortion view.
This commit is contained in:
parent
e71560a2ee
commit
da7ae53941
@ -21,6 +21,7 @@
|
||||
#include "LinearMath/btIDebugDraw.h"
|
||||
int gSharedMemoryKey = -1;
|
||||
int gDebugDrawFlags = 0;
|
||||
bool gDisplayDistortion = false;
|
||||
|
||||
//how can you try typing on a keyboard, without seeing it?
|
||||
//it is pretty funny, to see the desktop in VR!
|
||||
@ -831,15 +832,31 @@ void CMainApplication::RenderFrame()
|
||||
DrawControllers();
|
||||
}
|
||||
RenderStereoTargets();
|
||||
|
||||
if (gDisplayDistortion)
|
||||
{
|
||||
B3_PROFILE("RenderDistortion");
|
||||
RenderDistortion();
|
||||
} else
|
||||
{
|
||||
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
|
||||
glDisable( GL_MULTISAMPLE );
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, rightEyeDesc.m_nRenderFramebufferId );
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
|
||||
glBlitFramebuffer( 0, 0, m_nRenderWidth, m_nRenderHeight, 0, 0, m_nRenderWidth, m_nRenderHeight,
|
||||
GL_COLOR_BUFFER_BIT,
|
||||
GL_LINEAR );
|
||||
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0 );
|
||||
}
|
||||
|
||||
vr::Texture_t leftEyeTexture = {(void*)leftEyeDesc.m_nResolveTextureId, vr::API_OpenGL, vr::ColorSpace_Gamma };
|
||||
vr::VRCompositor()->Submit(vr::Eye_Left, &leftEyeTexture );
|
||||
vr::Texture_t rightEyeTexture = {(void*)rightEyeDesc.m_nResolveTextureId, vr::API_OpenGL, vr::ColorSpace_Gamma };
|
||||
vr::VRCompositor()->Submit(vr::Eye_Right, &rightEyeTexture );
|
||||
|
||||
}
|
||||
|
||||
if ( m_bVblank && m_bGlFinishHack )
|
||||
|
Loading…
Reference in New Issue
Block a user